• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Remove Junks From WordPress Header

By Abhishek Ghosh February 20, 2015 9:24 am Updated on February 20, 2015

Remove Junks From WordPress Header

Advertisement

There are Hundreds of Junks on WordPress Header, From Meta Name Generator To Post RSS. Here is How To Remove the Junks From WordPress Header. This guide is nothing new, frankly, there are lot of good guides on the same topic. Yet, you might get some links to the older guides which are helpful and 100% unique. Also, a practical fact – own blog work as own guide. It is not possible to remember everything like this stuffs.

 

Why We Remove Junks From WordPress Header

 

First reason is security – if your version of WordPress is publicly visible, except the hackers, script kiddies and NSA Agents, none basically need them. There can version specific backdoor or security flaw. Second reason is to speed up – not all the posts can be cached within 5 minutes – if you have 5K posts like us; with even a 4GB server plus different MySQL server, it takes a good time to write the Cache. HTML pages are not always served by W3TC by plugins, specially after publication of a post. Third reason is SEO – bots dislike same kind of useless data on every WordPress installation. Also, Post Feed can give 404. These are some of the reasons to remove these. Really Simple Discovery (RSD) sounds like a rocket science, normally this is not needed. You must know that :

Keeping the Main RSS Feed, that is usually of Feedburner; is essential for many web services. For that reason, you can simply add a static thing like this via either your Theme’s settings page or Header and Footer like Plugin :

Advertisement

---

Vim
1
<link rel=“alternate” type=“application/rss+xml” title=“The Customize Windows &raquo; Feed” href=“http://feeds.feedburner.com/TheCustomizeWindows”/>

http://feeds.feedburner.com/TheCustomizeWindows is our Feed. You must change it to yours one. Our WordPress default Feed is here – https://thecustomizewindows.com/feed/. As you know, Feedburner does not support HTTPS (at the time of writing). This is HSTS website. We do a different kind of cheating to reflect the changes on Feedburner. We use Akamai now! A bash script does the work.

Remove Junks From WordPress Header

 

Remove Junks From WordPress Header

 

Here are the things :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Removes the RSD link
remove_action(‘wp_head’, ‘rsd_link’);
// Removes the WordPress version
remove_action(‘wp_head’, ‘wp_generator’);
// Removes the main RSS feed which we were talking about
remove_action(‘wp_head’, ‘feed_links’, 2);
// Removes all the others extra RSS feed links
remove_action(‘wp_head’, ‘feed_links_extra’, 3);
// Remove link to index page
remove_action(‘wp_head’, ‘index_rel_link’);
// Removes windows live writer support
remove_action(‘wp_head’, ‘wlwmanifest_link’);
// Removes the random post link, may be injected by plugins
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0 );
remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10, 0 );
remove_action(‘wp_head’, ‘rel_canonical’, 10, 0 );

The commented out lines are for your understanding. Here is the clean version :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
remove_action(‘wp_head’, ‘rsd_link’);
remove_action(‘wp_head’, ‘wp_generator’);
remove_action(‘wp_head’, ‘feed_links’, 2);
remove_action(‘wp_head’, ‘feed_links_extra’, 3);
remove_action(‘wp_head’, ‘index_rel_link’);
remove_action(‘wp_head’, ‘wlwmanifest_link’);
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0 );
remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10, 0 );
remove_action(‘wp_head’, ‘rel_canonical’, 10, 0 );

Where you’ll add these? You’ll add these on your WordPress Theme (or Child Theme’s) functions.php file via (S)FTP or SSH. Yes, adding on wp-config.php might work, but that is not what normally people do. You can also Remove jquery.js and jquery-migrate.js in WordPress. It needs a bit care. You can remove the CSS and JS version too :

Vim
1
2
3
4
5
6
7
8
// removes the fucking ?ver= stuffs, needed for HSTS
function remove_cssjs_ver( $src ) {
    if( strpos( $src, ‘?ver=’ ) )
        $src = remove_query_arg( ‘ver’, $src );
    return $src;
}
add_filter( ‘style_loader_src’, ‘remove_cssjs_ver’, 1000 );
add_filter( ‘script_loader_src’, ‘remove_cssjs_ver’, 1000 );

If you do not use a good Syntax highlighter, back ticks will not make an inline code – if( strpos( $src,, this is a thing, which you’ll add not remove – here is how to convert back ticks to code.

Advanced (Optional) :

Whatever you will add, you can make it a simple plugin (remove the commented out lines, add your own stuffs) :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
/**
* Plugin Name: Head and Shoulder
* Plugin URI: please type your own website url
* Description: Head and Shoulder cleans dandruff of WordPress head
* Version: 1.0.0
* Author: Your Name
* Author UI: please type your own website url
* License: GNU GPL 3.0
*/
remove_action(‘wp_head’, ‘rsd_link’);
// add all the stuffs and save as something named like
// head–and–shoulder.php
// zip it. upload via WP Plugin adding page
// do not add php closure, your wordpress will die

Easy thing. So many people wrote the same thing; but none of them added a real screenshot of SSH screen, where actually we worked to add them. If it was faulty, you could not read this webpage!

P.S. : Removing the RSS stuffs can decrease the page loading speed quite paranormally.

Tagged With index_rel_link wp_head 2015 , wordpress remove_action rsd_link
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Remove Junks From WordPress Header

  • Remove WordPress Post Feed and Post Comment Feed

    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.

  • WordPress Feed and FeedBurner Feed : What is appropriate for you

    WordPress Feed and FeedBurner Feed has obvious simillarity and some points to distinguish them. It is not that, FeedBurner is free, so let us use it. There are reasons to give preference one over the another.

  • How to configure Feedburner so that it does not affect your SEO?

    Feedburner is very useful for a publisher of blogs since the free service lets you know how many people subscribe to RSS. Many content management tools used to disseminate an RSS feed, however none of them can get statistics on subscribers.

  • RSS Feed Subscription : Reasons why you are not getting RSS subscriber

    Many bloggers wonder why another’s blog gets more RSS feed subscribers and his blog does not. Here are some possible reasons, with solutions to help you attract more RSS subscribers.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy