GetSimple Support Forum

Full Version: Noindex, nofollow for single page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
I am a begginer in GetSimple and I have a first problem.
How i can block Google boots on a single page (no entire domain)?

I wanto to get <meta name="robots" content="noindex, nofollow"> (or else) in my single page, eg. noindex for mydomain.com/contact?
I would like to block a single page for robots only.
I don't see this option in GetSimple panel, mabey some plugin or how do it myself?
jasiek7 Wrote:Hi!
I am a begginer in GetSimple and I have a first problem.
How i can block Google boots on a single page (no entire domain)?

I wanto to get <meta name="robots" content="noindex, nofollow"> (or else) in my single page, eg. noindex for mydomain.com/contact?
I would like to block a single page for robots only.
I don't see this option in GetSimple panel, mabey some plugin or how do it myself?

If it's for a single page, the easiest way is to put the following directly into your template's head (Admin Theme/Edit Theme):
Code:
<?php if (return_page_slug() == 'contact') echo '<meta name="robots" content="noindex, nofollow">'; ?>
Or you could replace in your template:

Code:
<meta name="robots" content="index, follow" />

by:

Code:
<?php if (return_page_slug() == 'contact') { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } else { ?>
<meta name="robots" content="index, follow" />
<?php } ?>

That is, if you also want the rest of the pages to have that meta.
It works perfect. Great! Thanks a lot.
Thanks to Carlos and n00dles101 I have constructed the following solution with I18N Custom Fields Plugin to have the possibility to change the standard value for every page:

In the template:
Code:
<?php if (return_custom_field('robots') != '') { ?>
    <meta name="robots" content="<?php get_custom_field('robots'); ?>" />
<?php } else { ?>
    <meta name="robots" content="index, follow" />
<?php } ?>

I18N Custom Field setting in /data/other/customfields.xml (or set it up in Custom Fields configuration)
Code:
<item>
  <desc><![CDATA[robots]]></desc>
  <label><![CDATA[Robots Meta Tag]]></label>
  <type><![CDATA[dropdown]]></type>
  <value><![CDATA[index, follow]]></value>
  <option><![CDATA[index, follow]]></option>
  <option><![CDATA[index, nofollow]]></option>
  <option><![CDATA[noindex, follow]]></option>
  <option><![CDATA[noindex, nofollow]]></option>
</item>

You can control robots also with robots.txt in the (sub)domain root.
this could be developed as a simple yet very useful standalone plugin too.
ccagle8 Wrote:this could be developed as a simple yet very useful standalone plugin too.
Done: MetaRobots Plugin
Thanks! Nice work mikeh. As I use I18N Custom Fields Plugin already with this template and like to avoid to install many more plugins, I prefer the template solution for now, but nice that the GS-plugin-community is very active and fast.
I hope with time "over 2/3 use it plug-ins" crystallized out and are either integrated into the core or are particularly well supported. That would be a great step for GS, because I changed also from WP, because many do not care to update the plugins I used and this is stressing.

I have some in my mind; MetaRobots Plugin could evolve/integrate to a "SEO Plugin" or something similar doing some more things and so on.
ChriS Wrote:Thanks! Nice work mikeh. As I use I18N Custom Fields Plugin already with this template and like to avoid to install many more plugins, I prefer the template solution for now, but nice that the GS-plugin-community is very active and fast.
I hope with time "over 2/3 use it plug-ins" crystallized out and are either integrated into the core or are particularly well supported. That would be a great step for GS, because I changed also from WP, because many do not care to update the plugins I used and this is stressing.

I have some in my mind; MetaRobots Plugin could evolve/integrate to a "SEO Plugin" or something similar doing some more things and so on.

I have been working on a separate "SEO" plugin for quite some time. I should have it released to extend later tonight. I will make it include this feature as well.
ChriS Wrote:You can control robots also with robots.txt in the (sub)domain root.

...but you can´t prevent sites getting indexed with robots.txt - therefore mikeh´s plugin is a good solution. Even better would be a select field with "index/follow" / "noindex/follow" / "index/nofollow" / "noindex/nofollow" to fully use the seo advantage of the robots meta tag.