<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Tag: robots meta tag</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sat, 18 May 2013 18:50:09 +0000</pubDate>

<item>
<title>helgatheviking on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-20252</link>
<pubDate>Sun, 03 Apr 2011 15:34:33 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">20252@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;seems weird to me.  you don't normally echo things out when you are filtering
&#60;/p&#62;</description>
</item>
<item>
<title>Thompson on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-20240</link>
<pubDate>Sat, 02 Apr 2011 18:09:45 +0000</pubDate>
<dc:creator>Thompson</dc:creator>
<guid isPermaLink="false">20240@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Update for anyone who stumbles across this as I did when searching. The code above is outdated, but I figured out the current way to modify meta robots:&#60;/p&#62;
&#60;p&#62;	// Add noindex to terms/privacy/contact pages&#60;br /&#62;
	function my_robots() {&#60;br /&#62;
		if (is_page(array(45,142,56))) { //terms,privacy,contact&#60;br /&#62;
			echo '&#38;lt;meta name=&#34;robots&#34; content=&#34;noindex,follow&#34; /&#38;gt;';&#60;br /&#62;
			}&#60;br /&#62;
		else {&#60;br /&#62;
			echo '&#38;lt;meta name=&#34;robots&#34; content=&#34;index,follow&#34; /&#38;gt;';&#60;br /&#62;
			}&#60;br /&#62;
		}&#60;br /&#62;
	add_filter('thematic_show_robots', 'my_robots');
&#60;/p&#62;</description>
</item>
<item>
<title>bigtoe on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12422</link>
<pubDate>Sun, 16 May 2010 16:29:44 +0000</pubDate>
<dc:creator>bigtoe</dc:creator>
<guid isPermaLink="false">12422@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Figured it out.&#60;/p&#62;
&#60;p&#62;Looks like is_paged() doesn't work standing on its own and needs another conditional with it. And I'm just guessing.&#60;/p&#62;
&#60;p&#62;Thanks for playing wheel of fortune.&#60;/p&#62;
&#60;p&#62;Pasting my filter below so anybody else who wants to copy/use/modify/analyze/obfuscate/clean up/comment/study/port to assembly/delete/discuss it can do so.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function childtheme_create_robots() {
 if((is_home() &#38;#38;&#38;#38; !is_paged()) &#124;&#124; (is_front_page() &#38;#38;&#38;#38; !is_paged()) &#124;&#124; is_single() &#124;&#124; is_attachment()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;index,follow\&#38;quot; /&#38;gt;\n\n&#38;quot;;
 }
elseif (is_search()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,nofollow\&#38;quot; /&#38;gt;\n\n&#38;quot;;
 }
else {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;\n\n&#38;quot;;
 }
    return $content;
}
add_filter(&#38;#39;thematic_create_robots&#38;#39;, &#38;#39;childtheme_create_robots&#38;#39;);&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>bigtoe on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12371</link>
<pubDate>Fri, 14 May 2010 02:31:12 +0000</pubDate>
<dc:creator>bigtoe</dc:creator>
<guid isPermaLink="false">12371@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Please sir, may I have some help.&#60;/p&#62;
&#60;p&#62;So I gave this another shot, but apparently I suck.&#60;/p&#62;
&#60;p&#62;Here's what I got, and I'm still getting &#34;index,follow&#34; on &#34;example.com/page/3&#34; etc URLs. I need &#34;noindex,follow&#34;.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function childtheme_create_robots() {

 if(is_front_page() &#124;&#124; is_single() &#124;&#124; is_attachment()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;index,follow\&#38;quot; /&#38;gt;&#38;quot;;
 } elseif (is_search()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,nofollow\&#38;quot; /&#38;gt;&#38;quot;;
 } 

elseif (is_paged()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 } 

else {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 }
    return $content;
}
add_filter(&#38;#39;thematic_create_robots&#38;#39;, &#38;#39;childtheme_create_robots&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Where did I mess up?
&#60;/p&#62;</description>
</item>
<item>
<title>bigtoe on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12118</link>
<pubDate>Wed, 05 May 2010 05:54:39 +0000</pubDate>
<dc:creator>bigtoe</dc:creator>
<guid isPermaLink="false">12118@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Still can't figure this out. Anybody got a minute? Been cracking my head for hours.&#60;/p&#62;
&#60;p&#62;Do I need to modify this ((is_home() &#38;#38;&#38;#38; ($paged &#38;lt; 2 ))or is there some other statement I can add to the filter?&#60;/p&#62;
&#60;p&#62;Something like&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;elseif &#38;quot;/page/&#38;quot; {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 }&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I tried reversing the &#38;lt; sign, and a bunch of other things that got me syntax errors, but it ended up putting noindex on the front page. Yikes.&#60;/p&#62;
&#60;p&#62;Wish I were decent at php, but it makes my brain hurt.
&#60;/p&#62;</description>
</item>
<item>
<title>bigtoe on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12093</link>
<pubDate>Tue, 04 May 2010 19:32:36 +0000</pubDate>
<dc:creator>bigtoe</dc:creator>
<guid isPermaLink="false">12093@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Chris.&#60;/p&#62;
&#60;p&#62;Thanks for the reply. I did the the following, and I'm still showing &#34;index,follow&#34; for everything in /paged/ from the front page unfortunately.&#60;/p&#62;
&#60;p&#62;No idea what I'm doing wrong. Here's what I have.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function childtheme_create_robots() {
global $paged;
 if((is_home() &#38;#38;&#38;#38; ($paged &#38;lt; 2 )) &#124;&#124; is_front_page() &#124;&#124; is_single() &#124;&#124; is_attachment()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;index,follow\&#38;quot; /&#38;gt;&#38;quot;;
 } elseif (is_search()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,nofollow\&#38;quot; /&#38;gt;&#38;quot;;
 } 

else {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 }
    return $content;
}
add_filter(&#38;#39;thematic_create_robots&#38;#39;, &#38;#39;childtheme_create_robots&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Hopefully it's a simple fix. Thanks.
&#60;/p&#62;</description>
</item>
<item>
<title>Chris on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12089</link>
<pubDate>Tue, 04 May 2010 19:07:47 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid isPermaLink="false">12089@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;add &#60;code&#62;global $paged;&#60;/code&#62; as first line in your function.&#60;/p&#62;
&#60;p&#62;Chris
&#60;/p&#62;</description>
</item>
<item>
<title>bigtoe on "Help with thematic_create_robots custom filter please. :)"</title>
<link>http://themeshaper.com/forums/topic/help-with-thematic_create_robots-custom-filter-please#post-12087</link>
<pubDate>Tue, 04 May 2010 18:19:27 +0000</pubDate>
<dc:creator>bigtoe</dc:creator>
<guid isPermaLink="false">12087@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi there.&#60;/p&#62;
&#60;p&#62;I'm trying to modify a &#34;thematic_create_robots&#34; filter and it's not going well.&#60;/p&#62;
&#60;p&#62;Any help would be greatly appreciated.&#60;/p&#62;
&#60;p&#62;I would like to make &#60;a href=&#34;http://example.com/page/2&#34; rel=&#34;nofollow&#34;&#62;http://example.com/page/2&#60;/a&#62; and all those paged URLs have a &#34;noindex,follow&#34; robots meta tag, basically, the entire /page/ dir.&#60;/p&#62;
&#60;p&#62;I tried messing around with the ((is_home() &#38;#38;&#38;#38; ($paged &#38;lt; 2 )) bits, and it's not working, probably because I'm not very good with php.&#60;/p&#62;
&#60;p&#62;Do I need to create another elseif statement, and how?&#60;/p&#62;
&#60;p&#62;I don't have any SEO plugins installed, and would like to do this with the filter.&#60;/p&#62;
&#60;p&#62;Here's what I have in functions.php for your reference. Thanks in advance.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function childtheme_create_robots() {
 if((is_home() &#38;#38;&#38;#38; ($paged &#38;lt; 2 )) &#124;&#124; is_front_page() &#124;&#124; is_single() &#124;&#124; is_attachment()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;index,follow\&#38;quot; /&#38;gt;&#38;quot;;
 } elseif (is_search()) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,nofollow\&#38;quot; /&#38;gt;&#38;quot;;
 }
/*
elseif (is_page(&#38;#39;about-me&#38;#39;) {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 }
*/
else {
 $content .= &#38;quot;&#38;lt;meta name=\&#38;quot;robots\&#38;quot; content=\&#38;quot;noindex,follow\&#38;quot; /&#38;gt;&#38;quot;;
 }
    return $content;
}
add_filter(&#38;#39;thematic_create_robots&#38;#39;, &#38;#39;childtheme_create_robots&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;With the above, I get &#34;index,follow&#34; for everything in /paged/
&#60;/p&#62;</description>
</item>

</channel>
</rss>
