0121 274 2060

hello@colabdigital.co.uk

Begin your project today…


colab digital we build brands logo
  • Plugins
  • Web Development
  • WordPress

Make Yoast’s settings tab available to the WooCommerce ‘Shop Manager’ role

Empowering Shop managers…

The Problem

On quite a few recent WooCommerce website builds that we have developed for our clients, we found the Shop Manager user role to be about the best solution in order to give shop owners a clear view of their inventory, orders, pages, products and other important info, without overcrowding the WordPress admin area with things that they won’t use on a day-to-day basis. However, Yoast’s settings are hidden to Shop Managers (gasp!) …enter Colab Digital!

The Solution

To give WooCommerce Shop Managers access to Yoast’s settings and options tab, we created a function that looks to see if the current user is a shop_manager, and the function simply unhides the tab. Yes, that simple, but yet so hard to find, and we decided to share this little nugget of wisdom because we are nice 😉 .

So without further ado, here’s the code to give the WooCommerce shop_manager role access to Yoast’s settings and options tab, add this code to your theme’s functions.php file – and you’re away (you can thank us later!):

//Yoast Settings Access for Shop Managers
function colab_shop_manager_yoast_access() {
    $role = get_role( 'shop_manager' );
    $role->add_cap( 'wpseo_manage_options', true );
}
add_action( 'init', 'colab_shop_manager_yoast_access', 11 );

SHARE THIS

Also worth reading…