Download Concise, our LATEST Genesis Framework Child Theme. It's FREE

Download

How to Disable WordPress Theme Update Checks

If you’re building a WordPress theme for a client, it’s good to disable WordPress theme update checks to the theme. Mark Jacquith, one of WordPress core developers clearly explains the reason behind it:

Because WordPress (the software) doesn’t know whether a theme or plugin is listed in the WordPress.org repositories, it has to check them all, and let the repository sort it out. Some have expressed concern that private plugins developed for a single client could contain sensitive information in their headers, like contact information for the developer, etc.

Disabling theme update checks for non-distributed theme is also good thing in case it has a same name with the ones in WordPress.org theme repo.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php
 
/**
* Disable WordPress theme update checks
* If there is a theme in the repo with the same name,
* this prevents WP from prompting an update.
*
* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
* @author Mark Jaquith
* @since 1.0.0
*
**/
function afn_prevent_theme_update( $r, $url ) {
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) )
return $r; // Not a theme update request. Bail immediately.
$themes = unserialize( $r['body']['themes'] );
unset( $themes[ get_option( 'template' ) ] );
unset( $themes[ get_option( 'stylesheet' ) ] );
$r['body']['themes'] = serialize( $themes );
return $r;
}
add_filter( 'http_request_args', 'afn_prevent_theme_update', 5, 2 );
view raw functions.php hosted with ❤ by GitHub

All WordPress themes in WordPress.org repo have a unique name. However, the theme you built for the client might coincidentally has the same name with the one in the repo. In case there ones in the repo got any update, your client will see the update notification. As expected, if the client ever click on the update button, his site will be broken since the theme he’s using is not the same theme as the one from the repo.

By disabling the theme update checks, your client won’t see any notification for theme updates.

However, as a developer, it’s a good practice to keep your theme up to date with latest code or function. As a developer myself, I always prefer to use Genesis Framework. It’s a great framework and Mashable calls it as the “best of the best” among WordPress premium frameworks.

By using Genesis, I can spend less time maintaining the theme I built for clients as all of the themes were built as child theme. By developing them as child theme, I won’t lose any modifications made to the site when the client update the Genesis Framework (which can be done in single click).

Comments

  1. great article!!! I’m lucking to have this site, which update me on wordpress on regular basis. stay bless Wpspeak team.

  2. Nice Idea!. However I don’t agree with child themes. They increase WP loading time.

Leave a Comment

*