Support » Plugin: Yoast SEO » Yoast SEO and Woocommerce Swatches and Photos Bug Fix

  • Resolved gubbigubbi


    Hey all,

    Just wanted to report a bug I found with Yoast v3.1.1

    If you have the woocommerce extension (Woocommerce Swatches and Photos) installed then the image swatch type wont work properly when editing an existing swatch.

    I have worked out a temporary fix and posted it on my blog:

    The problem lies with the wp-seo-term-scraper.js file. It seems like because product attributes dont have any SEO options the js file looks for something that doesn’t exist and blocks up all javascript after that.

    The file class-taxonomy.php is where term-scraper is called (enqueued). So what I did was to use a return statement causing none of the woocommerce js to be called. To do this you need to edit line 80 of of class-taxonomy.php so it looks like this:

    $post_type = $_GET[“post_type”];

    if ( $GLOBALS[‘pagenow’] !== ‘edit-tags.php’ || $post_type == ‘product’ ) {

    All we are doing is checking to see if the post type is a product and then choosing to exit the sub routine (not proceed with the further lines of code).

    Original article

    Just wanted to bring it to your attention

  • The topic ‘Yoast SEO and Woocommerce Swatches and Photos Bug Fix’ is closed to new replies.