Remove SEO from Custom Post Types
-
I’d like for this plugin not to work on custom post types (because they are products in my webshop and I have another SEO plugin better for that specific purpose)
How would I go about doing that? In the All in on SEO plugin I could just select if there where post types I didn’t want to plugin to work for. ButI can’t find that option here.
-
It seems that this option is removed from the latest WordPress SEO version as it was initially added in version 0.2, check it here:
User’s attempt:
http://ww.wp.xz.cn/support/topic/plugin-wordpress-seo-by-yoast-remove-seo-for-custom-post-typeIf this is true, it’s pity as this is very important part when you use custom post types.
@ligefrem, do you use Jigoshop. Because I asked the same question one week ago.
@ivicad, this is not good news for us then!
@yoast, is there a way to get this back in the plugin again?
Kind regards,
Willem
Yep, Jigoshop it is
OK, if you get it working or have any news, let’s update each other ;-).
I need this too!
I need it to, in case if I wasn’t clear enough… I hope this would be possible in the near future.
Hello, I worked this out because I was could not work out why it was disabled. See my enable Yoast SEO post to show how you can enable/remove it
AMediaCompany, thanks for adding your findings here.
I believe that changing the ‘public’ value in register_post_type() has consequences beyond the SEO plugin that may not be desirable.
For my own situation, I found that disabling the appearance of the SEO meta-box on the custom post’s edit page was sufficient. (That’s in the SEO settings: Titles & Metas, Post Types Tab, “WordPress SEO Meta Box Hide” Checkbox for each post type).
martha_camelia, perhaps it does. In the case where you can use the Yoast SEO options to tick something on/off, then great. In my case I was not able to, hence I noted what I did. I’d rather not use public=> true
To remove Yoast SEO from a post type:
Make sure your post type does not contain the following code in the register post type:‘public’ => true
Where can I find this file, maybe I can change it to get it work.
Kind regards,
Willem
it depends on where your custom file type is defined.
I’d recommend doing what do what martha_camelia says first and look into the options of wordpress-seo and you could be able to remove it there
If via a plugin, take a look at the plugin
if in functions.php, take a look there
if in a file that functions.php includes, look there.If you’ve no idea, contact the person who designed/built your site. If you really haven’t got a clue, ask someone you trust to look at it. Remember, I’m just someone on the internet
Hi there, well in the file jigoshop_taxonomy.php from the Jigoshop plugin I found the code the use for registering the custom post type. And yes, there is a statement ‘public’ => true. What Martha_Camelia did is not working for me, on the Jigoshop forum I posted before:
Hi Ivica, I did a lot of testing to see where the problem maybe is. For sure I can tell you that the ‘hide option’ just hide the form but that’s not a function to enable/disable that part. I still got no answer from Yoast how I can do that. Anyone else with same problems?
Do you advise me to change the code for the Jigoshop plugin? Meaning: removing the line public – true. In my first thought I was thinking we should change something to the SEO plugin not to handle this custom posttype by Yoast SEO…
Hope to hear from you!
register_post_type( "product", array( 'labels' => array( 'name' => __( 'Products', 'jigoshop' ), 'singular_name' => __( 'Product', 'jigoshop' ), 'all_items' => __( 'All Products', 'jigoshop' ), 'add_new' => __( 'Add New', 'jigoshop' ), 'add_new_item' => __( 'Add New Product', 'jigoshop' ), 'edit' => __( 'Edit', 'jigoshop' ), 'edit_item' => __( 'Edit Product', 'jigoshop' ), 'new_item' => __( 'New Product', 'jigoshop' ), 'view' => __( 'View Product', 'jigoshop' ), 'view_item' => __( 'View Product', 'jigoshop' ), 'search_items' => __( 'Search Products', 'jigoshop' ), 'not_found' => __( 'No Products found', 'jigoshop' ), 'not_found_in_trash' => __( 'No Products found in trash', 'jigoshop' ), 'parent' => __( 'Parent Product', 'jigoshop' ) ), 'description' => __( 'This is where you can add new products to your store.', 'jigoshop' ), 'public' => true, 'show_ui' => true, 'capability_type' => 'product', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, // Hierarchial causes a memory leak http://core.trac.ww.wp.xz.cn/ticket/15459 'rewrite' => array( 'slug'=> $product_base, 'with_front'=> false, 'feeds'=> $base_slug ), 'query_var' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'excerpt',/*, 'page-attributes'*/ ), 'has_archive' => $base_slug, 'show_in_nav_menus' => false, 'menu_position' => 56 ) );it may or may not work; I’ve no knowledge of how the jigoshop plugin works.
I was assuming that you wanted to remove the form from the backend, which removing public=>true should work, but I have no idea how it would affect the plugin
To remove it from the front-end, on that post type (so you could safely ignore the SEO box on that plugin), I’m guessing you could remove the filter hooks that are used. I’ve not got a list of those, so you will be having to look around to see what needs to stop output on the front-end.
I asked Jigoshop developers if they have any idea on this, I’m waiting to see if there would be any ideas, hopefully yes…
@AMediaCompnany and IvicaD, thanks for the quick reply’s. Ivica, I will not change anything before we got answer from the devolopers. Keep me posted :-).
The topic ‘Remove SEO from Custom Post Types’ is closed to new replies.