Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3846568
Canonical indexing issues
Open

Comments

  •  11
    LillaGreen started the conversation

    I have received hundreds of issues with canonical indexing for urls like this one:

    https://lillagreen.com/semporna-sabah-travel-guide-discover-the-maldives-of-malaysia/?product-page=20

    After analyzing, I found where the issie is coming from. On my all blog posts i have right sidebar where i show 6 of my products. For the indexing issue, I’m getting the following message from Google:

    Alternative page with proper canonical tag
    These pages aren't indexed or served on Google.

    I also have variants of the products. Only the man product should be indexed, not the variants. Example:

    https://lillagreen.com/shop/wall-art-prints/farol-da-nazare-portugal-wall-art/?attribute_size=90x60+cm

    Another cannonical issue for indexing is Related blog post - they are also recognized as not properly indexed.

    The link, for example,  https://lillagreen.com/semporna-sabah-travel-guide-discover-the-maldives-of-malaysia/?product-page=20 does indeed look suspicious – especially because ?product-page=20 has nothing to do with a blog article.

     ?product-page=20  is a WooCommerce parameter that  appears on product archives or shop category pages.

    It is mistakenly being appended to other URLs, for example due to a THEME error, pagination within embedded products, or a shortcode or block that inserts a product grid into the article

    So ... I guess if I remove these things from the indexing (via txt. file), the issues will be gone??? I need you oppinion - is this the issue? And if yes, i may need your help on how to do it, what should i put in my txt file to stop indexing the SIDEBAR Widget wtih products and also RELATED PRODUCTS element from Soledad for elementor? Thank you in advnace

  •   LillaGreen replied privately
  •  2,781
    PenciDesign replied

    Hi,

    If you're using Yoast SEO, you can:

    1. Go to SEO → Search Appearance → Advanced.

    2. Under "Permalinks", look for an option to remove query parameters (?product-page=20).

    3. Enable "Remove Stop Words from Slugs" to help with canonical URLs.

    4. If needed, manually set canonical URLs in the Yoast Meta Box for individual product pages.

    Regards,
    PenciDesign.

  •  11
    LillaGreen replied

    Hi there, thank you for the idea. But I guess, this doesn't address the:

    • The cause of ?product-page=20 showing up in my blog post URLs.

    • The WooCommerce widget/sidebar behavior that generates these URLs.

      this should be somew how blocked on robot.txt?

  •  2,781
    PenciDesign replied

    Hi,

    Here is the other solution.

    You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/

    function fix_product_pagination_canonical() {
        if (isset($_GET['product-page']) && is_singular('product')) {
            echo '<link rel="canonical" href="' . get_permalink() . '" />' . "\n";
        }
    }
    add_action('wp_head', 'fix_product_pagination_canonical', 1);
    

    Regards,
    PenciDesign.