How to remove the nagging Yoast license notification

If removing this license notification is a must then there are several ways you can go about doing this.

First, you must keep in mind of upgrading in the future. But, we will show you multiple ways to do so.

Option 1 – Not a good idea for upgradability as you will constantly have to edit a core plugin file.

You will need to FTP into your web hosting and browse to the file located in

wp-content/plugins/wordpress-seo-premium/vendor/yoast/license-manager

Open the file “class-license-manager.php”

Around line 112 find

if ( ! $this->license_is_valid ) {

Change it to:

if ( $this->license_is_valid ) {

 

Option 2 –  Suitable for future upgrades

If you built your own theme or child theme then you can add this bit of code to your functions.php file

// remove yoast premium seo nag from admin dashboard
function remove_yoast_license_nag_from_admin_page() {
    echo
    '<style>
        div.yoast-notice-error {
            display: none;
        }
    </style>';
}
 
add_action('admin_head', 'remove_yoast_license_nag_from_admin_page');

Option 3 – Simple Plugin *Best suited for upgrading

  1. create a directory (folder) and give it a name. i.e. “remove-yoast-nag” (do not add the beginning ” and closing ” !)
  2. in this directory create a file and give it a name. i.e “remove-yoast-nag”
  3. make sure the file end with .php i.e. “remove-yoast-nag.php”
  4. add the following content to your “remove-yoast-nag.php file
/**
 * Plugin Name: Remove Yoast SEO Premium License Nag
 * Plugin URI: https://yoast.com/wordpress/plugins/seo-premium/
 * Description: Removes the Yoast SEO Premium license nag from your WordPress Dashboard. If you like this plugin buy a license key and receive support.
 * Author: !yoast_de_valk
 * Author URI: https://yoast.com/about-us/joost-de-valk/
 * Version: 1.0.0
 * License: GPL2+
 */

/**
 * Prevent direct access to files
 *
 * @since 1.0
 */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Nothing fancy here, just some css injection into the WordPress admin head
 */

 // remove yoast premium seo nag from admin dashboard
// remove yoast premium seo nag from admin dashboard
function remove_yoast_license_nag_from_admin_page() {
    echo
    '<style>
        div.yoast-notice-error {
            display: none;
        }
    </style>';
}

add_action('admin_head', 'remove_yoast_license_nag_from_admin_page');
  1. save the file and its content
  2. zip the directory (folder)
  3. install it to WordPress like any other “regular” plugin
  4. Activate the plugin
  5. All done.

Or, to save yourself a bunch of time download our plugin Remove Yoast SEO Nag Plugin. Remember if you like the authors work please buy a license and support his or her work!

Sharing is caring!

Leave a Reply