Jump to content

Meta robots on individual pages


jeng
 Share

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.

Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...

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
 Share

  • Recently Browsing   0 members

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