<?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>Running A Website &#187; Feeds</title>
	<atom:link href="http://www.runningawebsite.com/tag/feeds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.runningawebsite.com</link>
	<description>Practical tips and advice for running a successful website!</description>
	<lastBuildDate>Thu, 07 Oct 2010 10:20:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Disabling RSS Feeds in WordPress</title>
		<link>http://www.runningawebsite.com/disabling-rss-feeds-in-wordpress/</link>
		<comments>http://www.runningawebsite.com/disabling-rss-feeds-in-wordpress/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 10:59:32 +0000</pubDate>
		<dc:creator>Dan Harrison</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Feeds]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.danharrison.co.uk/?p=300</guid>
		<description><![CDATA[Sometimes, if you&#8217;re using WordPress as a content management system (CMS), you don&#8217;t want to enable RSS feeds. For example, if you&#8217;re running a corporate website, an informational site, or any other kind of website that doesn&#8217;t need to have RSS, then its worth disabling RSS on your WordPress site. After some digging around, I&#8217;ve ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.runningawebsite.com%2Fdisabling-rss-feeds-in-wordpress%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.runningawebsite.com%2Fdisabling-rss-feeds-in-wordpress%2F&amp;source=DanJHarrison&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.runningawebsite.com/wp-content/uploads/2009/07/Disabling-RSS-in-Wordpress.jpg" alt="Disabling RSS in WordPress" title="Disabling RSS in WordPress" width="250" height="250" class="aligncenter size-full wp-image-301" /></p>
<p>Sometimes, if you&#8217;re using WordPress as a content management system (CMS), you don&#8217;t want to enable RSS feeds. For example, if you&#8217;re running a corporate website, an informational site, or any other kind of website that doesn&#8217;t need to have RSS, then its worth disabling RSS on your WordPress site. After some digging around, I&#8217;ve found some tricks that allow you to disable RSS feeds. <span id="more-300"></span></p>
<p>I haven&#8217;t yet found a (non hacky) way to remove the RSS entry in the &lt;head&gt; tags, but when I do, I&#8217;ll update this article.</p>
<h3>Updating your template functions.php</h3>
<p>In your template code, if you copy and paste the following code into the <strong>functions.php</strong> file, users will get a message saying that RSS feeds have been removed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> disable_our_feeds<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   wp_die<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;strong&gt;Error:&lt;/strong&gt; No RSS Feed Available,
   Please visit our &amp;lt;a href=&quot;'</span><span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;homepage&lt;/a&gt;.'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_our_feeds'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_rdf'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_our_feeds'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_rss'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_our_feeds'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_rss2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_our_feeds'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_atom'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'disable_our_feeds'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Updating .htaccess</h3>
<p>To stop users reaching the RSS page in the first place, you can redirect <strong>domain.com/feed</strong> back to <strong>domain.com</strong> using your apache <strong>.htaccess</strong> file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Remove RSS feed</span>
&lt;<span style="color: #000000; font-weight:bold;">ifModule</span> mod_rewrite.c&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteBase</span> /
<span style="color: #00007f;">RewriteRule</span> feed(.*) http://www.yourwebsite.co.uk/ [L]
&lt;/<span style="color: #000000; font-weight:bold;">ifModule</span>&gt;</pre></td></tr></table></div>

<h3>Doing it with a plugin</h3>
<p>The code changes above should only be done if you know what you&#8217;re doing. If you still want to disable RSS feeds, but you&#8217;re not that comfortable editing code, then I suggest using the <a href="http://wordpress.org/extend/plugins/disable-rss/">Disable RSS plugin</a> to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.runningawebsite.com/disabling-rss-feeds-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

