• Resolved domino4evers

    (@domino4evers)


    Hi there

    Megafan of your plugin, thanks for that. But I have run into a little problem.

    I am using WC-marketplace, and their SEO plugin, so the vendors can write their own seo titles, descriptions and so on. The other pages, i wanna use Yoast SEO, but the it overwrites the seo titles and descriptions on the products pages.

    Is there anyway to disable the Yoast SEO on product pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could try this code snippet in your active themes functions.php or in a code snippet on your site.

    function remove_yoast_metabox_product(){
        remove_meta_box('wpseo_meta', 'product', 'normal');
    }
    add_action( 'add_meta_boxes', 'remove_yoast_metabox_product',11 );

    Tested using the current version of WooCommerce 3.8.0, Yoast SEO 12.4 and on a dev site running RC5 of WordPress 5.3.

    • This reply was modified 5 years, 4 months ago by Luke Cavanagh. Reason: clarify wording
    • This reply was modified 5 years, 4 months ago by Luke Cavanagh. Reason: clarify wording
    Sa?a

    (@stodorovic)

    Usage of remove_meta_box isn’t good because it’s possible that some JS or other code will be loaded. There is option in admin which could “hide” metabox (and there are filters which can do same in PHP code).

    Anyway, I think that you want to remove stuff which Yoast SEO adds in HTML head section (which previous solution can’t remove). In this case, you should unhook some actions (wp_title, wp_head and wpseo_head) which is tricky without advanced PHP/WP knowledge.

    That was a code snippet to remove the meta boxes when editing products in wp-admin from product list it does not effect anything on the front-end of the site. There are a couple of plugin options to easily remove Yoast SEO parts from loading in the header.

    As this topic has not had any activity in over a week, we will close this in order to keep the overview. If the issue continues to happen please feel free to make a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable Yoast SEO on product pages.’ is closed to new replies.