Skip to content

Instantly share code, notes, and snippets.

@bjornbjorn
Created November 19, 2015 08:44
Show Gist options
  • Save bjornbjorn/9489023b9b4b38c76cf2 to your computer and use it in GitHub Desktop.
Save bjornbjorn/9489023b9b4b38c76cf2 to your computer and use it in GitHub Desktop.
Remove "Page Analysis" + "Focus Keyword" functionality from Yoast SEO
// Note, I used Timber so my functions.php includes a class that extends TimberSite, but the gist here will be the same;
// add an action that outputs css in the admin to hide some Yoast SEO features.
// in functions.php, add this action:
add_action('admin_head', array($this, 'wpseo_css'));
// Then you need this wpseo_css function in the same class:
/**
* This will remove the "Page Analysis" tab from WPSEO + remove the Focus keyword
*/
public function wpseo_css() {
echo '<style>
#linkdex {
display:none;
}
#wpseo_meta .wpseotab.general table.form-table tr:nth-child(2) {
display:none;
}
</style>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment