Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a Wordpress site using custom post types, and I have also got the All In One SEO pack installed.

I wondered if anyone knows a hack or a modification I can make to the code which will allow me to stop the pictured area from showing up on certain custom post types?

enter image description here

Any help much appreciated.

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

If you're satisfied with disabling the SEO-Pack on all CPTs, go with brasoflo's answer.

Should you want to keep the metabox for some CPTs and disable it only for a select few:

function wpse_55088_remove_aiosp() {
    remove_meta_box( 'aiosp', 'movie', 'advanced' );
}
add_action( 'add_meta_boxes', 'wpse_55088_remove_aiosp' );

Where 'movie' is, going with brasoflo's answer, the name of the CPT. Repeat the call to remove_meta_box(); for each post type you want to target. If it's a fairly high number, you could wrap it in a loop:

function wpse_55088_remove_aiosp() {
    $cpts = array( 'movie', 'album', 'clip', 'trailer' );

    foreach( $cpts as $cpt ) {
        remove_meta_box( 'aiosp', $cpt, 'advanced' );
    }
}
add_action( 'add_meta_boxes', 'wpse_55088_remove_aiosp' );

It might sound a bit confusing, that I suggest hooking the function with the 'add_meta_boxes' action when you want to remove one, but this action runs after all meta boxes have been added, hence that's when existing ones can be removed. If you ran the function too early, the box would get added afterwards.

share|improve this answer
    
Genius! This worked an absolute treat. Thank you very much! :) –  Adam Moss Jun 13 '12 at 14:02
add comment

Looks like it's just a matter of configuring the plugin...
/wp-admin/options-general.php?page=all-in-one-seo-pack/aioseop.class.php

enter image description here

share|improve this answer
    
I've tried this but for some reason it won't work - didn't know if there's perhaps a bug in my version. Do you know which function looks at this data? –  Adam Moss Jun 13 '12 at 13:37
    
@AdamMoss - Nope... it works for me with AIOSP Version 1.6.14.3... but Johannes solution works quite well. –  brasofilo Jun 13 '12 at 13:44
    
You're right I think this is supposed to work, but my version must have something wrong. I've used Johannes solution –  Adam Moss Jun 13 '12 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.