Here is How to Remove WordPress Post Feed and Post Comment Feed Via Snippet and Plugins With the Explanation of All Types of Feeds Generated. These tweaks are for optimizing the crawling by the search engine bots. More you will customize and simplify your WordPress powered website’s HTML output, more easily Google can Crawl. WordPress has very limited number of useful plugins. Most are useless, sometimes harmful. None ever tests all the 22 thousand or some number of plugins officially available, snippets are for the advanced users, Plugins are for the new users. These are one of the reasons of getting 404 Errors against a WordPress website on Google Webmasters Tools apart from the reasons we wrote before. 404 for the non existing URLs must not be redirected internally. Rather the reason should be removed.
Remove WordPress Post Feed and Post Comment Feed : Understanding the Feeds
Normally the advanced users use Genesis (GNU GPL Theme Framework with Premium Support) or Woo (same like Genesis) or Thesis (same like Genesis) the default WordPress Theme. Genesis has an advantage – buy once and forget. We purchased one License long back, that framework is running on all the domains. Woo is also good and has some free themes. We can not say about the other badly coded Themes. Genesis and WordPress Default WordPress theme has common developers. Function of WordPress is not altered – other Themes can act peculiarly. If our fix does not work; essentially it is for the Theme. We have no support for any paid theme. Do not download themes from questionable sources.
By default, WordPress generates these kind of Feeds :
---
Type of Feed Generated By WordPress | Intended Function | Example | Safe to Remove? | Gives 404 Error? | Generated By File |
---|---|---|---|---|---|
All Posts Feed | Main Feed of Your Website. Intended for Indexing. | ./feed/ | No | No by Default | ./wp-rss2.php ./wp-rss.php ./wp-rdf.php |
All Comments Feed | Comment Feed of Your Website. Intended for Re-crawling. | ./comments/feed/ | Yes | No by Default | ./wp-commentsrss2.php |
Individual Post Feed | Unknown | ./2014/12/install-wordpress-nginx-hhvm-ubuntu-cloud-server/feed/ | Yes. Must be Removed | Varies. May give 301 to the original Post. | |
Individual Page Feed | Unknown | ./contact-us/feed/ | Yes. Must be Removed | Varies. May give 301 to the original Page. | |
Archives | Intended for Indexing. | ./archives/feed/ ./2014/feed/ ./category/computer-and-internet/cloud-computing/feed/ | Varies. | No by Default. | |
Search Feed | Unknown | ./search/cloud-computing/feed/ | No if JSON-LD based Schema is Used. | No. 301 redirects to search : ./?s=cloud+computing |
Yoast WordPress SEO removes some, not all the RSS feeds. Somehow the intended function does not work properly at least on Nginx PHP5-FPM setup with MySQL powered by InnoDB Engine. Yoast does not use Class I servers (Rackspace, HP Cloud etc.) nor is used with Platform as a Service (PaaS) like Heroku or OpenShift. It is abnormal to think that Yoast is using HHVM with RabbitMQ. Do it yourself.
Remove WordPress Post Feed and Post Comment Feed : Snippets
The impact of these junks appears in two places :
- The HTML source code of the individual Post
- Website’s Main Feed
Feed can give these junks in main xml feed :
1 2 3 4 5 6 | ... https://thecustomizewindows.com/2014/12/public-key-pinning-support-nginx-ubuntu-cloud-server/#respond ... https://thecustomizewindows.com/2014/12/public-key-pinning-support-nginx-ubuntu-cloud-server/feed/ 0 |
Post can have all kind of junks. Google bots try to find the provided URIs.
This is the thing which can change your life :
1 | ./wp-includes/default-filters.php |
If you check WordPress Settings
> Reading Settings
you’ll understand you can not control the comment feeds. To remove the version thing both from WordPress Post’s HTML source and Feed, you can add this snippet to your Theme/Child Theme’s function.php
or wp-config.php
. Yeah, adding things to wp-config.php
should work but basically it is better not to make the file heavy :
1 2 3 4 | add_filter('the_generator', 'donkey_complete_version_removal'); function donkey_complete_version_removal() { return ''; } |
donkey
is just a name. I could use thecustomizewindows
. Adding this will remove all the comments and other feed links :
1 2 | remove_action('wp_head', 'feed_links_extra', 3 ); remove_action('wp_head', 'feed_links', 2 ); |
Here are all the snippets with description of what they does :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | // Removes the links to the extra feeds, i.e. category feeds remove_action( 'wp_head', 'feed_links_extra', 3 ); // Removes links to the Post and Comment Feed remove_action( 'wp_head', 'feed_links', 2 ); // Removes the link to the Really Simple Discovery service endpoint remove_action( 'wp_head', 'rsd_link'); // Removes the link to the Windows Live Writer remove_action( 'wp_head', 'wlwmanifest_link'); // Removes the index link remove_action( 'wp_head', 'index_rel_link'); // Removes the prev link remove_action( 'wp_head', 'parent_post_rel_link'); // Removes the start link remove_action( 'wp_head', 'start_post_rel_link'); // Removes the relational links remove_action( 'wp_head', 'adjacent_posts_rel_link'); // Removes the WordPress version number remove_action( 'wp_head', 'wp_generator'); |
Remove WordPress Post Feed and Post Comment Feed : Plugins
So far, we have discovered these Plugins to useful :
1 2 3 | https://wordpress.org/plugins/adminimize/ https://wordpress.org/plugins/fp-rss-category-excluder/ https://wordpress.org/plugins/osd-remove-all-wp-creds/ |
Yoast WordPress SEO removes some but not all the stuffs. Basically WordPress needs to be covered to Python or Ruby like Language with a better Database Software. PHP is an inferior language, one simple comments field can help the hacker to run SQL injection. WordPress, for the many has been a kind of Open Source vendor locked software. It is basically impossible to suddenly convert a website with 5K posts to Octopress or any Python based WordPress like web software.