{"id":287,"date":"2008-10-30T14:09:58","date_gmt":"2008-10-30T13:09:58","guid":{"rendered":"http:\/\/wpengineer.com\/?p=287"},"modified":"2009-01-30T02:56:50","modified_gmt":"2009-01-30T01:56:50","slug":"disable-wordpress-feed","status":"publish","type":"post","link":"https:\/\/wpengineer.com\/287\/disable-wordpress-feed\/","title":{"rendered":"Disable WordPress Feed"},"content":{"rendered":"<p>A really good feature for many websites and already a standard on many blogs is the possibility to subscribe via feed for new posts.<\/p>\n<p>But if you use WordPress for a specific purpose, for example as a CMS, it&#8217;s possible that you really don&#8217;t need that feature because it has no extra value for your users. Maybe because you only have static pages or you just don&#8217;t want to spread your news this way.<\/p>\n<p>For everybody who doesn&#8217;t need the feed functionality in WordPress I show you in a little tutorial how to deactivate all formats of a feed in WordPress.<br \/>\n<!--more--><br \/>\nThe easiest way, which I personally don&#8217;t recommend, is to adjust your code in the core files. You can find the responsible code in <code>wp-settings.php<\/code>, in your root of WordPress.<\/p>\n<pre lang=\"php\">require (ABSPATH . WPINC . '\/feed.php');<\/pre>\n<p>With this method you have an easy way to deactivate, but you have to do it again when the next update for WordPress is knocking on your door. That can be a torture, especially when the automatic update is coming along with WordPress 2.7 &#8211; <a href=\"https:\/\/wpengineer.com\/how-core-update-in-wordpress-27-works\/\">How core update in WordPress 2.7 works<\/a>.<\/p>\n<p>A little bit more time consuming method is to deactivate feeds via hook in your theme or a Plugin. You just have to copy the following lines and copy them into <code>functions.php<\/code> of your theme. If this file doesn&#8217;t exist, just create it and WordPress will recognize it.<br \/>\nThe feed is not deleted, but the user gets an info. In detail, the feed URL will still exist, but if the user put in the URL directly, he doesn&#8217;t get any content but a text, which is been placed in the following code.<\/p>\n<pre lang=\"php\">\r\n\/**\r\n * disable feed\r\n *\/\r\nfunction fb_disable_feed() {\r\n\twp_die( __('No feed available,please visit our <a href=\"'. get_bloginfo('url') .'\">homepage<\/a>!') );\r\n}\r\n\r\nadd_action('do_feed', 'fb_disable_feed', 1);\r\nadd_action('do_feed_rdf', 'fb_disable_feed', 1);\r\nadd_action('do_feed_rss', 'fb_disable_feed', 1);\r\nadd_action('do_feed_rss2', 'fb_disable_feed', 1);\r\nadd_action('do_feed_atom', 'fb_disable_feed', 1);\r\n<\/pre>\n<p>That&#8217;s an easy way to disable feeds on your website.<br \/>\nI do adjustments like this also for my clients in the backend. I only show my clients what they really need to see. Functions, which he doesn&#8217;t need for his use are hidden &#8211; easily possible with my Plugin <a href=\"http:\/\/wordpress.org\/extend\/plugins\/adminimize\/\">Adminimize<\/a>. More about Adminimize in a future post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A really good feature for many websites and already a standard on many blogs is the possibility to subscribe via feed for new posts. But if you use WordPress for a specific purpose, for example as a CMS, it&#8217;s possible that you really don&#8217;t need that feature because it has no extra value for your [&hellip;]<\/p>\n","protected":false},"author":321,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[52,50,51,274],"class_list":["post-287","post","type-post","status-publish","format-standard","hentry","category-wordpress-hacks","tag-atom","tag-feed","tag-rss","tag-wordpress-tutorials"],"_links":{"self":[{"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/posts\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/users\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/comments?post=287"}],"version-history":[{"count":0,"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/posts\/287\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/media?parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/categories?post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengineer.com\/wp-json\/wp\/v2\/tags?post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}