Monday, December 30, 2019

WordPress Header Se Unnecessary Tags Kaise Remove Kare [Better Speed & Security Ke Liye]

WordPress Header Se Unnecessary Tags Kaise Remove Kare [Better Speed & Security Ke Liye]

WordPress adds a lot of tags / element to the header of our site. Due to which our site is very slow loading. Today I am going to tell you about how to remove unnecessary tags / elements from wordpress site? With which you can make your site fast loading.
remove tags elements from wordpress tags
WordPress is the best CMS for creating blogs. In this, PHP + MySQL has been used the most. Apart from this, javascript and CSS have also been used. There are many useful features in WordPress, so that anyone can easily manage the blog in it.
WordPress is also a very fast loading CMS. But I cannot say that it is the fastest. Since you know that coding like php, javascript, css is very slow and these are mostly used in it. But wordpress has been optimized to a great extent for loading speed. Many wordpress developers are also working in this.
If you have a wordpress blog, you must have noticed at the time of checking the source code that there is a lot of useless code in the header area. Maybe, this code is beneficial for developers but it is useless for us. These tags / elements do not play any important role for us. If you do not know how to check the source code of your blog, then open your blog in the browser and press CTRL + U button.
If we have too many unnecessary tags / elements to load, the loading speed of the site is very bad. There are no such tags in the header of Blogspot blog. So if you want to make your site fast loading, then all these tags have to be removed.
In this post, we are going to talk about how to remove unnecessary tags from the header of a WordPress blog? With which you can make your blog more fast. For this, you have to add some codes to your Theme's functions.php.
Table of Contents
The way I told you above that a lot of unnecessary tags are generated in the header of the wordpress blog. This weakens the security of our site. Along with this, the loading speed of the site is also affected. Now you must be wondering who can be these tags? Through which you too can see the source code of your site. I am showing you the list of these tags below.
        


Above we told that which are the useless tags in the head of our site. And we also told its disadvantages. Now we are going to tell you how to remove it. We are telling you the tag and the code to remove it below.

1. Remove EditURI / RSD (Really Simple Discovery) link:

There will be some such code show in the head of your blog.

To remove it, add the code below to your theme's functions.php.
remove_action ('wp_head', 'rsd_link');

2. Remove wlwmanifest (Windows Live Writer) link:

There will be some kind of code show in the source of your blog.

If you do not use windows live writer, then it is useless for you. So, to remove it, add the code below to your blog's functions.php.
remove_action ('wp_head', 'wlwmanifest_link');

3. Remove meta name generator:

There will be some such code in your blog head.

We have a lot of disadvantage with this code being shown. This means that the hacker finds out about our wordpress version and it becomes much easier to hack our site. It is very important to remove it. For this, you add the following code to functions.php.
remove_action ('wp_head', 'wp_generator');

4. Remove ShortLink

Your blog head will have some such URL.

This is the short link. If you do not use the short link. Meaning if you do not share the shortlink in social media, then it is of no use to you. To remove it, you can add this code to functions.php.
remove_action ('wp_head', 'wp_shortlink_wp_head');

5. Remove Feed Links:

There will be such feed link show in the head of your blog.

If you want to remove it, then add this code to your blog theme's functions.php.
remove_action ('wp_head', 'feed_links', 2);

6. Remove Comment Feed:

This code will also be added to the header of your blog.

By the way, it is not very important. Use this code to remove it.
remove_action ('wp_head', 'feed_links_extra', 3);

7. Remove api.w.org relation link:

This is something like this in the header of your blog –

To remove it, add this code to the functions.php of the blog theme.
remove_action ('wp_head', 'rest_output_link_wp_head', 10);
remove_action ('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action ('template_redirect', 'rest_output_link_header', 11, 0);

8. All Functions.php Codes:

If you want to remove all the tags mentioned above, for this you copy the below code and remove all the tags / elements from the header of the blog at once.
/ * Remove Extra Header Tags by BloggingHindi ** /
remove_action ('wp_head', 'rsd_link'); remove_action ('wp_head', 'wlwmanifest_link'); remove_action ('wp_head', 'wp_generator');
remove_action ('wp_head', 'wp_shortlink_wp_head'); remove_action ('wp_head', 'feed_links', 2);
remove_action ('wp_head', 'feed_links_extra', 3);
remove_action ('wp_head', 'rest_output_link_wp_head', 10);
remove_action ('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action ('template_redirect', 'rest_output_link_header', 11, 0);
Finally,
It is necessary to remove all these elements. With this security is weak and loading speed is also very slow. If you want to make your blog faster, then you should not forget these small steps. Earlier, I used a plugin to remove them from my blog. But now I use these codes.

If you liked this post, then share it on social media. If you have any question related to this post, then comment.

No comments:

Post a Comment