<?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>Design Gala &#187; hack</title>
	<atom:link href="http://designgala.com/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://designgala.com</link>
	<description>Web Usability, Web Technology, User Experience</description>
	<lastBuildDate>Wed, 02 May 2012 03:55:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to Exclude Categories from RSS Feed in WordPress</title>
		<link>http://designgala.com/how-to-exclude-categories-from-rss-feed-in-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-exclude-categories-from-rss-feed-in-wordpress</link>
		<comments>http://designgala.com/how-to-exclude-categories-from-rss-feed-in-wordpress/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:30:23 +0000</pubDate>
		<dc:creator>Anish Lama</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.designgala.com/?p=392</guid>
		<description><![CDATA[Last week I wrote about how to disable WordPress RSS feed completely from end users. Sometimes there are cases where we want posts from certain categories not to publish in RSS feed; we...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.designgala.com/wp-content/uploads/2009/11/wplogo-stacked-rgb-300x186.png" alt="wplogo-stacked-rgb" title="wplogo-stacked-rgb" width="300" height="186" class="alignright size-medium wp-image-411" />Last week I wrote about <a href="http://www.designgala.com/an-easy-hack-to-disable-rss-feeds-in-wordpress/" title="how to disable WordPress RSS feed completely">how to disable WordPress RSS feed completely</a> from end users. Sometimes there are cases where we want posts from certain categories not to publish in RSS feed; we just wish to unpublish post in feed.</p>
<p>There are 2 ways to disable categories in feeds.</p>
<h3><strong>1. If you&#8217;re a feedburner user</strong></h3>
<p>You&#8217;ll have to edit the original feed source in your feedburner account like below;</p>
<p>http://designgala.com/feed?cat=-7&#038;cat=-18</p>
<p>Above URL would exclude posts from categories with ID 7 and 18</p>
<h3><strong>2. From standard RSS feed</strong></h3>
<p>In order to use this method, you need to add following code in function.php of your active theme.</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* disable RSS feed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> exclude_categories_in_feed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_feed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cat'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'-7,-18'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$query</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pre_get_posts'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'exclude_categories_in_feed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>I hope this was short but cool wordpress hack to exclude categories from RSS feed.
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove --></p>
]]></content:encoded>
			<wfw:commentRss>http://designgala.com/how-to-exclude-categories-from-rss-feed-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>An easy Hack to Disable RSS feeds in WordPress</title>
		<link>http://designgala.com/an-easy-hack-to-disable-rss-feeds-in-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-easy-hack-to-disable-rss-feeds-in-wordpress</link>
		<comments>http://designgala.com/an-easy-hack-to-disable-rss-feeds-in-wordpress/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 17:51:37 +0000</pubDate>
		<dc:creator>Anish Lama</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[disable rss feeds]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.designgala.com/?p=344</guid>
		<description><![CDATA[RSS feed is one of the best feature of WordPress for sharing post. But there are cases where feeds either have little importantce or does not have any roles to play as in...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.designgala.com/wp-content/uploads/2009/11/disable_rss_wordpress.jpg" alt="disable rss wordpress" title="disable rss wordpress" class="alignright size-full wp-image-346" />RSS feed is one of the best feature of WordPress for sharing post. But there are cases where feeds either have little importantce or does not have any roles to play as in static websites, CMS. For all who do not need RSS feature in WordPress it can be disabled with a little effort.</p>
<h3><strong>Step 1:</strong></h3>
<p>Create a new function in <em>function.php</em> located in your active theme folder like below:</p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* disable RSS feed
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> wp_disable_feed<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;">'Sorry, no feeds available, return to &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;">'wp_disable_feed'</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;">'wp_disable_feed'</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;">'wp_disable_feed'</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;">'wp_disable_feed'</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;">'wp_disable_feed'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>I told you. Its very easy to disable feeds.</p>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove --></p>
]]></content:encoded>
			<wfw:commentRss>http://designgala.com/an-easy-hack-to-disable-rss-feeds-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

