WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Which template for */page/01/ etc. ? How to add noindex. (10 posts)

  1. shambhavi
    Member
    Posted 7 years ago #

    Hello,

    I want to add noindex,follow to the template for URLs w/the /page/ directory.

    Could someone let me know where / how to do this?

    Thanks so much

  2. whooami
    Member
    Posted 7 years ago #

    There's some problems with that..

    Since 2.2 (which you appear to be using) has the option to turn this off an on on a global( all the different wordpress generated pages) basis - this becomes sort of tricky.

    Paging is taken care of category.php, archive.php, author.php, etc..basically all the template pages except single.php and index.php (if you use those extra templates)

    If you dont, and simply rely on index.php and single.php then youre going to need to perform some extra php magic to do that.

    I realize reading this that it makes no sense. The point is, what you want to do is a great idea for a plugin.

  3. shambhavi
    Member
    Posted 7 years ago #

    Cool, cos I don't have the chops to do what you suggest.

    Here's why I want to do it. I use the all-in-one seo plugin that blocks indexing of categories and archives, but not /page/*.

    I use robots.txt to disallow indexing of /page/.

    But if someone comes to a /page/* thru an external link, then it bypasses robots.txt. I am finding that, slowly, these /page/ pages are being indexed, causing duplicate content.

    Perhaps I am explaining the obvious--but I'm just hoping someone will pick this up and write that plugin!

    Thanks.

  4. whooami
    Member
    Posted 7 years ago #

    well */page/* is a function of category and archive.php so ..that plugin, ideally ought to be handling that.

    But if someone comes to a /page/* thru an external link, then it bypasses robots.txt.

    "Someone" doesnt matter -- for all intents and purposes, Googlebot is what matters. And Googlebot reads your robots.txt and knows what to do with whats inside of it - whether it reads it yesterday or today.

    Additionally, it should be pointed out that if you watch your server logs, Googlebot doesn't check your robots.txt each time it spiders your site.

  5. shambhavi
    Member
    Posted 7 years ago #

    it should be pointed out that if you watch your server logs, Googlebot doesn't check your robots.txt each time it spiders your site.

    Good to know. I'm new to server logs. Just looked at one the other day for the first time.

    Also, when I look at the source for a /page/, the header says index,follow even tho I have categories and archives blocked w/all-in-one.

  6. whooami
    Member
    Posted 7 years ago #

    ermm, I dunno.

    Im looking at this page, for instance:

    http://www.livingtantra.net/category/generosity/page/2/

    and clearly in your source, I see this:

    <!-- all in one seo pack 0.6.2.5 -->
    <meta name="robots" content="noindex,follow" />

    I think you might need to clear your cache.

    Give me a link to "paged" page where you see something else?

  7. shambhavi
    Member
    Posted 7 years ago #

    Oh, I see the confusion-- I wasn't specific enough.

    Here is an example.

    http://www.livingtantra.net/page/2/

    The one you gave is a category page.

    Thanks so much.

  8. whooami
    Member
    Posted 7 years ago #

    the display of that "page" is controlled by index.php -- that's why it's different.

    Nontheless, why are you concerning yourself with stuff that youve not linked to.. In other words, I saw nowhere your on your site where I was able to bring up a url like that (unless I missed it).. search bots dont create links, they follow them -- If i cant find a link, a spider isnt going to either.

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Try using is_paged().

    Alternatively, the paged content template is "paged.php". You might try making one of those and modifying that.

  10. shambhavi
    Member
    Posted 7 years ago #

    ok, thanks all.

Topic Closed

This topic has been closed to new replies.

About this Topic