• Resolved hassanb

    (@hassanb)


    I have a canonical tag I want to remove and I found this:

    function wpseo_canonical_exclude( $canonical ) {
    global $post;
    if (is_single( ‘348’ )) {
    $canonical = false;
    }
    return $canonical;
    }

    It is said that we place this code in function.php.
    I’m new to wordpress, is it function in wordpress or in theme folder ?
    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @hassanb,

    Thanks for using the Yoast SEO plugin. Can you share the URL of the page that has the canonical URL you want to remove?

    Thread Starter hassanb

    (@hassanb)

    Thank you.
    Here is the page : https://marrakechsoul.com/

    Plugin Support Maybellyne

    (@maybellyne)

    Checking that page, I see that the canonical URL is the HTTP version. Do you experience this on other pages as well?

    • This reply was modified 1 year ago by Maybellyne.
    Thread Starter hassanb

    (@hassanb)

    On other pages I have this :
    <link rel=”canonical” href=”https://marrakechsoul.com/fr/marrakech-la-ville-ocre/” />

    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for the confirmation. Please edit the homepage and check that the canonical URL field in the advanced tab of the Yoast SEO meta box is blank

    Thread Starter hassanb

    (@hassanb)

    Yes it is blank.

    Plugin Support Maybellyne

    (@maybellyne)

    Great! That allows the Yoast SEO plugin to use self-referencing canoncial URLs. Next, try these steps:

    1. Install & activate the Yoast Test Helper plugin
    2. Go to Tools > Yoast Test
    3. Locate the Yoast SEO section and click on the ‘Reset indexables tables & migrations‘, ‘Reset Prominent words calculation‘, and ‘Reset Internal link counter‘ buttons. After each click, the page will reload to confirm that the specific reset was successful.
    4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization” button to allow Yoast to rescan your content.

    Please let us know if the reported issue remains after resetting the optimized data.

    Thread Starter hassanb

    (@hassanb)

    I did what you asked.
    Here is the results :

    <link rel=”canonical” href=”https://marrakechsoul.com/fr/” class=”yoast-seo-meta-tag” />

    <link rel=”canonical” href=”https://marrakechsoul.com/” class=”yoast-seo-meta-tag” />

    Plugin Support Maybellyne

    (@maybellyne)

    This is what I see <link rel="canonical" href="https://marrakechsoul.com/" />. I don’t see two canonical URL tags

    Thread Starter hassanb

    (@hassanb)

    So in your opinion everything is ok now ?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Canonical tag’ is closed to new replies.