Turn off Genesis theme SEO feature

If you find this free website useful – why don’t you support this with a donation? It is easy…. read more ….

Genesis framework comes with an in-built SEO feature. This is great, unless you don’t want it and want to turn it off to use another plugin

The creators of Genesis have thought of this and have set it up to automatically switch off when another popular SEO plugin is installed.

However, what if the plugin you are using is one that Genesis doesn’t detect? Or you want to turn off Genesis SEO for another reason?

Well the developers have made it easy with a filter that you can adjust the array of detection criteria. The array contains ‘classes’, ‘functions’ and ‘constants’ and you can just use the filter to add the appropriate item.

The detection array looks like this at the time of writing

array(

      // Classes to detect.
      'classes' => array(
              'All_in_One_SEO_Pack',
              'All_in_One_SEO_Pack_p',
              'HeadSpace_Plugin',
              'Platinum_SEO_Pack',
              'wpSEO',
              'SEO_Ultimate',
               ),
       // Functions to detect.
               'functions' => array(),
       // Constants to detect.
                'constants' => array( 'WPSEO_VERSION', ),
)

 

So a very simple approach would be to define a constant in wp-config.php , e.g. define( ‘HIDE_GENESIS_SEO’, true );

and then add the following to your functions.php to append the constant to the detection array via the filter ‘genesis_detect_seo_plugins’

add_filter( 'genesis_detect_seo_plugins', 'turn_off_seo' );
function turn_off_seo( $array ) {	
	$array['constants'][] = 'HIDE_GENESIS_SEO';
	return $array;
}

One SEO plugin that is not detected is WPMUdev’s Infinite SEO. If you want your Genesis theme to auto detect this then the following code in your functions.php should do the trick

add_filter( 'genesis_detect_seo_plugins', 'add_infinite_seo' );
function add_infinite_seo( $array ) {
	$array['functions'][] = '_wds_init';
	return $array;

}

 

 


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *