Jump to content
Sign in to follow this  
jeng

Meta robots on individual pages

Recommended Posts

I'm fairly new to PW and after searching through the forums, I haven't found a good answer.

How do I go about tagging individual pages with the meta robots tag?

ie. I have a site with blog category/topic pages and would like to tag these pages as 'noindex/follow'.

Is there a way to do this easily (a checkbox/field or a module) or will I need to edit the templates? 

Thanks.

Share this post


Link to post
Share on other sites

you would decide which pages need to have that tag, so for example if they were all pages of a certain template named "something" you would use this in the head:

<?php if($page->template == 'something') { ?>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<?php } ?>

or if you had a checkbox called "no_robots", then like this:

<?php if($page->no_robots == 1) { ?>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<?php } ?>
 
  • Like 2

Share this post


Link to post
Share on other sites

right, no problem - also i copied those tags from somewhere on the web, but I don't think it's necessary for them to be all caps; all lowercase seems to be the current fashion.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...