Disable WordPress Theme “Update Available” Notification

David Nash wordpress 20 Comments

I’ve been customising a theme that had a new version, getting the message “There is a new version of … available”. I didn’t want the end-user to update the theme, because I’d customised it so heavily. I know that any updates are going to need to be done by a WordPress theme developer.

After a while of searching through code, looking for add_action and add_filter hooks, and even delving into the database, I realised I could just edit the theme’s style.css and remove the “Version:” line from the WordPress specific CSS header right at the top. And the notification (and oh so dangerous link) went away!

Summary: Delete ‘Version’ line altogether from the theme’s /style.css file.

Comments 20

  1. Alternatively, instead of deleting the line altogether, just enter the latest version number of the theme. If you use a version, say, 1.2 and the notofication says update to 1.3, then simply enter 1.3 in your css.

  2. I’ve searched countless times for some kind of article about how to actually roll out theme updates. Do you have any idea how make a theme updatable across many different sites?

  3. On newer WordPress versions and most new themes, deleting this line will not help anymore, however changing the Version to something rediculously high will.

    Version 79.9.9

    should be sufficient as it is very unlikely that the version would be higher then (let’s say) 9.8.1

  4. I did an update to the latest version of a theme, but the theme author forget to change the version number in the new style.css file.

    So the theme update notification keeps telling me that my theme version is outdated.

    After I simply changed the version to the correct number in the style.css file, the notification stopped annoying me. 😉

    Perfect solution, thanks!

    1. Post
      Author
  5. I found another way of doing this with a hook as I was needing it to only be disabled on the parent theme but still wanted the version number for tracking reasons. After digging through the source to track where this was being done I found it in the wp_prepare_themes_for_js function in wp-admin/includes/theme.php. There are two hooks but the one that I found most useful is is the wp_prepare_themes_for_js hook.

    $theme = ‘nameoftheme’;
    add_filter(‘wp_prepare_themes_for_js’, function($prepared_themes) use ($theme){
    $prepared_themes[$theme][‘update’] = ”;
    $prepared_themes[$theme][‘hasUpdate’] = false;
    return $prepared_themes;
    }, 20, 1);

    1. Actually, I found a much better solution as this will disable the update in the wordpress update area as well.

      $theme = ‘themename’;
      add_filter(‘site_transient_update_themes’, function($value) use ($theme) {
      unset($value->response[$theme]);
      return $value;
      }, 10, 1);

  6. Modifying/adding the following to the style.css comments worked for me (WordPress version 4.7.2)

    ———

    Version: 999.0.0 dummy version to disable update notification of lapsed premium theme subscription
    Version Actual: 2.3.4 with patch from https://github.com/ajdruff/divi

    ———-

    In my case I had a lapsed subscription of a premium theme in which I didn’t want an update link that would prompt for a subscription upgrade.

    Note that the comments I added after the version number don’t invalidate the version checking, and allows you to be pretty clear what you’re doing. If I remove the Version line altogether, the notification still appears, but leaves blank the current version number in the message.

Leave a Reply

Your email address will not be published. Required fields are marked *