Jump to content

Recommended Posts

Posted

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.

Posted

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
  • 4 weeks later...
Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...