<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>engfer(s) &#187; Wordpress</title>
	<atom:link href="http://www.engfers.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.engfers.com</link>
	<description>» scrumptions blog &#038; code » nothing more, nothing less</description>
	<lastBuildDate>Tue, 06 Oct 2009 21:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Side Note On WordPress, SEO, sitemap.xml and robots.txt</title>
		<link>http://www.engfers.com/2008/11/10/a-side-note-on-wordpress-seo-sitemap-dot-xml-and-robots-dot-txt/</link>
		<comments>http://www.engfers.com/2008/11/10/a-side-note-on-wordpress-seo-sitemap-dot-xml-and-robots-dot-txt/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 22:31:57 +0000</pubDate>
		<dc:creator>engfer</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.engfers.com/?p=920</guid>
		<description><![CDATA[Last week, I learned that WordPress doesn&#8217;t ship with a default robots.txt. this is the default file that search engine crawlers parse to see what resources and URL patterns that it allowed and not allowed to crawl; it&#8217;s step 1 in every search engine optimization (SEO) guide. I guess I just stupidly assumed that it [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-924 aligncenter" title="wordpress-equals-no-robots" src="http://www.engfers.com/wp-content/uploads/2008/11/wordpress-equals-no-robots.png" alt="" /></p>
<p>Last week, I learned that <em>WordPress doesn&#8217;t ship with a default </em><strong>robots.txt</strong>.</p>
<ul>
<li>this is the default file that search engine crawlers parse to see what resources and URL patterns that it allowed and <em>not </em>allowed to crawl; it&#8217;s step 1 in every search engine optimization (SEO) guide.</li>
</ul>
<p>I guess I just stupidly assumed that it was included in WP. Anyways, I thought it to be fair to tell everyone that if you are using <strong>WordPress</strong> and you care how your site shows up in search results, you should generate a <code>robots.txt</code> and a <code>sitemap.xml</code>.<br />
<span id="more-920"></span><br />
<div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-9461422058527053";
google_ad_slot = "5057152483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<h3 class="hrule"><span style="color: #3366ff;">Robots.txt?</span></h3>
<p>Know that it&#8217;s important for search engines. Read this:</p>
<ul>
<li><strong><a href="http://www.robotstxt.org/robotstxt.html">http://www.robotstxt.org/robotstxt.html</a></strong></li>
</ul>
<p><strong>** NOTE</strong>: Not <strong>all </strong>web crawlers are <strong>guaranteed </strong>to read example.com/robots.txt; it serves as a guideline.</p>
<h3 class="hrule"><span style="color: #3366ff;">I Feel Dumb&#8230;</span></h3>
<p>I feel like an idiot, <strong>and I should</strong>. The other day I just happened to search for &#8220;engfers&#8221; on Google, and the result that came back was my site with an indented sub-result that was some error from a file in the <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP-Super-Cache plugin</a>. I thought to myself, <em>why is the plugins/ directory being crawled?</em></p>
<p>Needless to say, I <em>shortly thereafter</em> found <strong><a href="http://www.google.com/webmasters/tools">Google&#8217;s Webmaster Tools</a></strong> to help rectify my situation. It&#8217;s a pretty nice web-app that allows you to remove content from Google&#8217;s search (which I then used).</p>
<p>I also noticed that the webmaster tools had sections for analyzing your <strong>robots.txt</strong> and <strong>sitemap.xml</strong>. Well, I was surprised to find out that <strong>this site</strong> <strong>didn&#8217;t have a robots.txt</strong>.</p>
<p>Most of you are probably think that I&#8217;m an idiot because that&#8217;s <em>SEO 101</em>. Well yes, it is; however, I didn&#8217;t realize that <strong>WordPress doesn&#8217;t ship with a default robots.txt</strong>! Don&#8217;t ask me why I didn&#8217;t see that before because I don&#8217;t know. Nevertheless, I think WP <strong>should </strong>ship with a robots.txt that <strong>AT LEAST</strong> eliminates  plugins/ and wp-include/ from being crawled.</p>
<h3 class="hrule"><span style="color: #3366ff;">Our Shiny, New robots.txt</span></h3>
<p>There seems to be a billion and one SEO blogs out there; however, I was looking for resources for a robots.txt optimized for WordPress.</p>
<p>I found a couple of <a href="http://www.askapache.com/seo/updated-robotstxt-for-wordpress.html"><strong>articles</strong></a> and <a href="http://www.askapache.com/seo/wordpress-robotstxt-seo.html"><strong>examples</strong></a> at <a href="http://www.askapache.com">askapache.com</a> and an example from <a href="http://codex.wordpress.org/Search_Engine_Optimization_for_WordPress#Robots.txt_Optimization"><strong>the WordPress.org Codex</strong></a>.</p>
<p>The final version of our robots.txt (<a href="http://www.engfers.com/robots.txt">http://www.engfers.com/robots.txt</a>) was pulled from the WordPress Codex page.</p>
<pre>User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /trackback
Disallow: /feed
Disallow: /comments
Disallow: /category/*/*
Disallow: */trackback
Disallow: */feed
Disallow: */comments
Disallow: /*?*
Disallow: /*?
Allow: /wp-content/uploads

# Google Image
User-agent: Googlebot-Image
Disallow:
Allow: /*

# Google AdSense
User-agent: Mediapartners-Google*
Disallow:
Allow: /*

# Internet Archiver Wayback Machine
User-agent: ia_archiver
Disallow: /

# digg mirror
User-agent: duggmirror
Disallow: /

# Sitemap
Sitemap: http://www.engfers.com/sitemap.xml</pre>
<p><span style="color: #ff0000;"><strong>**NOTE: This file </strong><strong><em>must </em>to be at the <em>ROOT </em>of your web server!</strong></span></p>
<h3 class="hrule"><span style="color: #3366ff;">Final Note: sitemap.xml</span></h3>
<p>The big-daddy search engines like Google, Yahoo, Microsoft, etc use your site&#8217;s <strong>sitemap.xml</strong> (example.com/sitemap.xml) to make it easier crawl your website. It&#8217;s also a very important point of SEO; just do a bit of searching on it.</p>
<p>The final line in our robots.txt points to the sitemap:</p>
<pre>Sitemap: http://www.engfers.com/sitemap.xml</pre>
<p>For <strong>WordPress</strong>, use a plugin like the <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/"><strong>Google Sitemap Generator</strong></a>, to have it automacially generate the sitemap for you.</p>
<p>+1 = Moreover, It will automatically regenerate the sitemap.xml when you publish or edit a new article or page. =)<br />
<div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-9461422058527053";
google_ad_slot = "5057152483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.engfers.com/2008/11/10/a-side-note-on-wordpress-seo-sitemap-dot-xml-and-robots-dot-txt/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>New WordPress Plugin: TinyMCE Valid Elements</title>
		<link>http://www.engfers.com/2008/11/06/new-wordpress-plugin-tinymce-valid-elements/</link>
		<comments>http://www.engfers.com/2008/11/06/new-wordpress-plugin-tinymce-valid-elements/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 17:37:21 +0000</pubDate>
		<dc:creator>engfer</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.engfers.com/?p=866</guid>
		<description><![CDATA[We wrote a new WordPress plugin and created a page for it: TinyMCE Valid Elements By default, WordPress’ WYSIWYG editor, TinyMCE, will strip out of your Article and Page HTML code any elements that are not defined as “valid elements”; this can be extremely annoying (especially if you want to include iframes). This plugin will [...]]]></description>
			<content:encoded><![CDATA[<p>We wrote a new WordPress plugin and created a page for it:</p>
<p><a style="padding: 1px 0px 1px 20px; background: transparent url(http://www.engfers.com/wp-content/uploads/2008/11/plugin.gif) no-repeat scroll left center" href="http://www.engfers.com/plugins/tinymce-valid-elements/"><strong>TinyMCE Valid Elements</strong></a></p>
<blockquote><p><em>By default, WordPress’ WYSIWYG editor, TinyMCE, will strip out of your Article and Page HTML code any elements that are not defined as “valid elements”; this can be extremely annoying (especially if you want to include iframes).</em></p>
<p><em>This plugin will allow you to extend what TinyMCE defines as “valid elements”. By doing so, TinyMCE will no longer remove, delete, or strip-out the additional elements and attributes that you specify.</em></p></blockquote>
<p>Check it out!</p>
<p><div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-9461422058527053";
google_ad_slot = "5057152483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.engfers.com/2008/11/06/new-wordpress-plugin-tinymce-valid-elements/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Allow Stripped Element Attributes in WordPress&#8217; TinyMCE Editor</title>
		<link>http://www.engfers.com/2008/10/16/how-to-allow-stripped-element-attributes-in-wordpress-tinymce-editor/</link>
		<comments>http://www.engfers.com/2008/10/16/how-to-allow-stripped-element-attributes-in-wordpress-tinymce-editor/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:29:33 +0000</pubDate>
		<dc:creator>engfer</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.engfers.com/?p=635</guid>
		<description><![CDATA[The proper way to correct any attributes that TinyMCE strips off of your WordPress posts/pages&#8217; elements is to use the tiny_mce_before_init filter hook. Unfortunately, WordPress doesn&#8217;t document this very well, so I will. UPDATE: 2008-11-06: I have made a WordPress plugin that does this for you! » TinyMCE Valid Elements The Wrong Way I found [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-640 aligncenter" title="Stop stealin my attributes TinyMCE!" src="http://www.engfers.com/wp-content/uploads/2008/10/stealin_my_attributes.png" alt="" width="450" height="70" /></p>
<p>The proper way to correct any attributes that TinyMCE strips off of your WordPress posts/pages&#8217; elements is to use the tiny_mce_before_init filter hook. Unfortunately, WordPress doesn&#8217;t document this very well, so I will.</p>
<p><div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-9461422058527053";
google_ad_slot = "5057152483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<p><span style="color: #ff0000;"><strong>UPDATE: 2008-11-06: I have made a WordPress plugin that does this for you!</strong></span></p>
<p>» <a style="padding: 1px 0px 1px 20px; background: transparent url(http://www.engfers.com/wp-content/uploads/2008/11/plugin.gif) no-repeat scroll left center" href="http://www.engfers.com/plugins/tinymce-valid-elements/"><strong>TinyMCE Valid Elements</strong></a><br />
<span id="more-635"></span></p>
<h3 class="hrule"><span style="color: #3366ff;">The Wrong Way</span></h3>
<p>I found <a href="http://ellisweb.net/2008/08/using-syntaxhighlighter-to-format-code-in-wordpress/">many examples</a> out there on the webs that say to edit wp-includes/js/tinymce/tiny_mce_config.php and concat to TinyMCE&#8217;s init() your <strong>extended_valid_elements</strong>. However, this is <span style="color: #ff0000;"><strong>dumb and incorrect</strong></span> because the <strong>second another WordPress update comes out</strong>, it will <strong>overwrite </strong>that file and you will <strong>lose your changes</strong>.</p>
<h3 class="hrule"><span style="color: #3366ff;">The Right Way</span></h3>
<p>The better thing to do is to change the <span style="color: #ff0000;"><strong>extended_valid_elements</strong></span> property in the WordPress TinyMCE init array via the <strong><span style="color: #ff0000;">tiny_mce_before_init</span> filter hook</strong>.</p>
<p>What WordPress doesn&#8217;t tell you is what the filter hook expects as <em>parameters </em>and <em>return </em>types, so listen up!</p>
<p>The <em>tiny_mce_before_init filter hook</em> expects:</p>
<ul>
<li><strong>Parameters</strong>:
<ul>
<li>Associative array of existing TinyMCE init variables</li>
</ul>
</li>
<li><strong>Returns</strong>:
<ul>
<li>The same associative array that you may or may not have modified.</li>
</ul>
</li>
</ul>
<pre>/**
 * Add to extended_valid_elements for TinyMCE
 *
 * @param $init assoc. array of TinyMCE options
 * @return $init the changed assoc. array
 */
function my_change_mce_options( $init ) {
    // Command separated string of extended elements
    $ext = 'pre[id|name|class|style]';

    // Add to extended_valid_elements if it alreay exists
    if ( isset( $init['extended_valid_elements'] ) ) {
        $init['extended_valid_elements'] .= ',' . $ext;
    } else {
        $init['extended_valid_elements'] = $ext;
    }

    // Super important: return $init!
    return $init;
}

add_filter('tiny_mce_before_init', 'my_change_mce_options');</pre>
<p><div align="center"><script type="text/javascript"><!--
google_ad_client = "pub-9461422058527053";
google_ad_slot = "5057152483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<p><span style="color: #ff0000;"><strong>UPDATE: 2008-11-06: I have made a WordPress plugin that does this for you!</strong></span></p>
<p>» <a style="padding: 1px 0px 1px 20px; background: transparent url(http://www.engfers.com/wp-content/uploads/2008/11/plugin.gif) no-repeat scroll left center" href="http://www.engfers.com/plugins/tinymce-valid-elements/"><strong>TinyMCE Valid Elements</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.engfers.com/2008/10/16/how-to-allow-stripped-element-attributes-in-wordpress-tinymce-editor/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
