Created
June 13, 2012 23:57
-
-
Save chrisguitarguy/2927217 to your computer and use it in GitHub Desktop.
Remove some of WordPress SEO's analysis features. Because I don't need them and they are distracting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Fix WPSEO | |
Description: Remove WordPress SEO's analysis features. | |
Author: Christopher Davis | |
Author URI: http://christopherdavis.me | |
License: GPL2 | |
Copyright 2012 Performance Media Group | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program; if not, write to the Free Software | |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
add_action('admin_init', 'pmg_fix_wpseo_init'); | |
function pmg_fix_wpseo_init() | |
{ | |
global $wpseo_metabox; | |
remove_action( | |
'post_submitbox_misc_actions', | |
array($wpseo_metabox, 'publish_box') | |
); | |
remove_action( | |
'restrict_manage_posts', | |
array($wpseo_metabox, 'posts_filter_dropdown') | |
); | |
foreach(get_post_types() as $pt) | |
{ | |
add_filter( | |
"manage_{$pt}_posts_columns", | |
'pmg_fix_wpseo_columns', | |
20 | |
); | |
} | |
add_filter( | |
'wpseo_metabox_entries', | |
'pmg_fix_wpseo_focuskw' | |
); | |
} | |
function pmg_fix_wpseo_columns($cols) | |
{ | |
$nope = array( | |
'wpseo-score', | |
'wpseo-focuskw' | |
); | |
foreach($nope as $n) | |
{ | |
if(isset($cols[$n])) | |
unset($cols[$n]); | |
} | |
return $cols; | |
} | |
function pmg_fix_wpseo_focuskw($mb) | |
{ | |
if(isset($mb['focuskw'])) | |
unset($mb['focuskw']); | |
return $mb; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment