• 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

This Article Has Been Shared 398 Times!

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

  • Dedicated Server Hosting for WordPress Blog : Why and When to think

    Dedicated Server Hosting for WordPress Blog is definitely the best Hosting option. But, the cost of dedicated Server is the limiting factor. Here are the points when you will think for a dedicated host for your WordPress blog.

  • Responsive Web Design, Grid System and Mobile Website

    Responsive Web Design, Grid System and Mobile Website are used for making a website easily viewable on any mobile devices including Tablets. Here is a guide.

  • AdSense Asynchronous Ads with Responsive Design

    AdSense Asynchronous Ads with Responsive design is a quite difficult to manage or implement. Here are some ideas which might help you for HTML5 website.

  • Google+ Embedded Posts : Easy Guide

    Google+ Embedded Posts, unlike Google+ Interactive Posts do not demand much technical knowledge or access to API. It is really simple to work with single post.

  • RESTful API for WordPress to Enable Public HTTP GET Request for Posts

    RESTful API for WordPress Can Enable Many Features to a Website Like We Can Fetch Data for Facebook Page from Widget via HTTP GET Request.

Additionally, 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

  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023
  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Remove Junks From WordPress Header," in The Customize Windows, February 20, 2015, March 30, 2023, https://thecustomizewindows.com/2015/02/remove-junks-from-wordpress-header/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT