Menu
 

How To - Remove Your WordPress Build Number

WordPress is a famous and widely used content management system. You must be knowing that WordPress can track your site, thanks to the footprints it leaves in its software that let the outside world know what version of WordPress you are using.
If, for any reasons, you don’t update your WordPress blog regularly, these footprints may be a security leak, though simply hiding your version of WordPress is not enough by itself to protect you from potential threats.

There might be various methods available but only best solution is to keep an up-to-date version of WP and keep strong username/password. But here i am going share a way to remove Build number. You might know that WordPress version number appears in four areas on your site:

 The Generator Meta Tag In The Header

<meta name="generator" content="WordPress 4.0" />

 Query Strings On Scripts And Styles

If a script or style doesn’t specify a version number when enqueued, the current version of WordPress is used instead.

subscriptions.css?ver=4.0

 The Generator Tag In RSS Feeds

<generator>http://wordpress.org/?v=4.0</generator>

To hide your version of WordPress in all three areas, simply add the following code to your functions.php file.

/* Hide WP version strings from scripts and styles* @return {string} $src* @filter script_loader_src* @filter style_loader_src*/function fjarrett_remove_wp_version_strings( $src ) {global $wp_version;parse_str(parse_url($src, PHP_URL_QUERY), $query);if ( !empty($query['ver']) &amp;&amp; $query['ver'] === $wp_version ) {$src = remove_query_arg('ver', $src);}return $src;}add_filter( 'script_loader_src', 'fjarrett_remove_wp_version_strings' );add_filter( 'style_loader_src', 'fjarrett_remove_wp_version_strings' ); /* Hide WP version strings from generator meta tag */function wpmudev_remove_version() {return '';}add_filter('the_generator', 'wpmudev_remove_version');

 Readme.html File In WP Root 

Your readme.html file in root of your WP site. You have to manually remove Build number tag from this file.

Above code will help you to strip your version number from all three areas of your site. Check your site’s page source before and after adding the code to see how it works.

If you like this post, please share it on your social networks.

Post a Comment Blogger

Please Do not Spam. Give us Positive feedback to make this blog more better.

 
Top