Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress one-time role/capability fix for Yoast SEO on Multisite
if ( ! function_exists( 'my_add_seo_caps' ) ) {
function dnc_add_seo_caps() {
// Get admin role
$role = get_role( 'administrator' );
// Add YOAST SEO Roles
$role->add_cap( 'wpseo_manage_options' );
$role->add_cap( 'wpseo_edit_advanced_metadata' );
$role->add_cap( 'wpseo_manage_redirects' );
$role->add_cap( 'wpseo_bulk_edit' );
}
add_action( 'init', 'my_add_seo_caps' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment