Useful Snippets

Welcome!


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

Are your smart devices spying on you? Make better purchasing choices and find products that respect your privacy at Unwanted.cloud

RSS Latest posts from my personal blog


Subscribe to RSS feed


Disable TGM Plugin Activation nag screen.

Stanislav KhromovStanislav Khromov

Seeing this?

disable-tgmp-nag

Here’s a quick way to disable it globally and permanently. Save the below snippet and put it in your /wp-content/mu-plugins folder (create it if it doesn’t exist), and you’re done!

<?php
/*
Plugin Name: Disable TGM Plugin Activation Notices
Plugin URI:
Description: Disables notices about recommended plugins.
Version: 2014.03.27
Author: khromov
Author URI: http://profiles.wordpress.org/khromov/
License: GPL2
*/

add_filter('get_user_metadata', function($val, $object_id, $meta_key, $single)
{
    if($meta_key === 'tgmpa_dismissed_notice')
        return true;
    else
        return null;

}, 10, 4);
PHP

Full-stack impostor syndrome sufferer & Software Engineer at Schibsted Media Group

Comments 6
  • Iain Mars
    Posted on

    Iain Mars Iain Mars

    Reply Author

    Hi Stanislav is there a way to get this snippet in the functions.php file?

    Thanks


    • Stanislav Khromov
      Posted on

      Stanislav Khromov Stanislav Khromov

      Reply Author

      Hey Iain,

      Just copy row 12-19 into your themes functions.php and you’re golden. :-)


  • Antonio Tamayo
    Posted on

    Antonio Tamayo Antonio Tamayo

    Reply Author

    Sorry but not work for me. I am using the 2.5.2 tgm-plugin-activation version and this snippet not work. I need help thanks.


  • Antonio Tamayo
    Posted on

    Antonio Tamayo Antonio Tamayo

    Reply Author

    Already have the solution for my issue. Change “tgmpa_dismissed_notice” by “tgmpa_dismissed_notice_tgmpa”. This work fine for me.


  • David
    Posted on

    David David

    Reply Author

    Just thank you very much! I also add to change `tgmpa_dismissed_notice` by `tgmpa_dismissed_notice_tgmpa` but every thing was just nerve saving!

    Thank you :-)