• Home
  • Archive
  • Tools
  • Contact Us
  • Forum

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
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 :

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 :

Advertisement

---

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 Google+ Pinterest

About Abhishek Ghosh

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

Follow the Author of this article :

13.7K+ Followers 18.7K+ Followers 2.5K+ Followers 1.5K Followers

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 Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

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

Search this website...

 

 

Popular Articles

All articles of this Website are fully Free to read. Here are some, which possibly you'll like to read! Do not hesitate to contact us for any concern.

Contact Us

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

Recent Posts

  • Example of Using IBM Watson For Text Analysis with Google Docs April 20, 2018
  • Arduino WiFi Control of LED From Web Browser April 19, 2018
  • Fix Problems & Issues of Yoast SEO WordPress Plugin April 19, 2018
  • Extra Battery, Inverter For Car For DIY Electronics Car Automation April 18, 2018
  • Blink AC Bulb With Arduino Relay Module April 17, 2018

About This Article

Title: Remove Junks From WordPress Header
February 20, 2015
Author: Abhishek Ghosh
Subjects: Computer and Internet, WordPress and SEO, WordPress Weblogs tips
Is Part Of:

TheCustomizeWindows, February 20, 2015, Vol.1(01),
p.1–39075 [IoT Ready Journal]

Source:The Customize Windows
ISSN: 0019-5847 ;
E-ISSN: 0019-5847 ;
Publisher: jima.in

Cite this article as: Abhishek Ghosh, "Remove Junks From WordPress Header," in The Customize Windows, February 20, 2015, April 20, 2018, https://thecustomizewindows.com/2015/02/remove-junks-from-wordpress-header/.
This website uses cookies.

Read Cookie Policy

Contents are copyright protected and reproduction demands our permission.


PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

web analysis

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

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