• Resolved audioprolabs

    (@audioprolabs)


    Hello,
    I analyzed my page I got this error:

    Webpage and canonical link tag points to different URLs.
    Website url:

    Url found in the canonical link tag:

    I would like to change the canonical URL that is generating by the plugin Yoast. The problem is that I do not see any option that allows me to do this in the settings of the Yoast plugin, and I can not see where I can change the generated code. I have already tried to make this change using the filters but this only caused more problems with the other pages. This problem is only for my home page, all the other pages are OK. I used this filter code to solve the problem:

    }
    function yoast_seo_canonical_change( $canonical ) {
    return ‘https://audioprolabs.com’;
    }
    add_filter( ‘wpseo_canonical’, ‘yoast_seo_canonical_change’, 10, 1 );

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Jerlyn

    (@jerparx)

    To know how you can change the canonical URL, please check this article: https://kb.yoast.com/kb/canonical-urls-in-wordpress-seo/

    To know the SEO-benefit of a canonical URL, this article will give you more information: https://yoast.com/rel-canonical/

    Thread Starter audioprolabs

    (@audioprolabs)

    In the picture you have pasted, I can see settings that are not present in my Yoast plugin, the option to write a conanical is not present. I have already tried to make this change using the filters written in this article but this only caused more problems. Is there another way to do this? Can you write me the code to change only the canonical URL of my home page?

    Thread Starter audioprolabs

    (@audioprolabs)

    In the picture you have pasted, I can see settings that are not present in my Yoast plugin, the option to write a conanical is not present. I have already tried to make this change using the filters written in this article but this only caused more problems, that code always returns all pages to the main page. As a result all my pages are declared to the root of the domain as URL canonical, when it must be the URL itself.
    You can see this example:
    https://audioprolabs.com/tutoriales-pro-tools/pro-tools-12/tutorial-pro-tools-12-edicion-de-audio

    Google sees as canonical
    https://audioprolabs.com

    After deleting this code everything seems OK. Is there another way to do this? Can you write me the code to change only the canonical URL of my home page without affecting all the other pages?
    best regards

    Plugin Support marcanor

    (@marcanor)

    Hi @audioprolabs,

    If you click on the gear icon in the Yoast Metabox, you should find the field to change the canonical. See image for reference: https://imgur.com/aCYgGml

    If you don’t have this option, can you please send us a screenshot of what you see in your Yoast Metabox settings?

    We checked the source code of your frontpage and we see that the canonical URL points correctly to itself. See image located here: https://imgur.com/a/iWc6bn6

    Can you confirm if the issue is fixed?

    Thread Starter audioprolabs

    (@audioprolabs)

    Hello,
    doing a test I’m getting this result:
    Webpage and canonical link tag points to different URLs.

    Website url:
    https://audioprolabs.com

    Url found in the canonical link tag:
    https://audioprolabs.com/

    The canonical URL generated by the plugin Yoasthas a bar at the end.
    I also have a option to change the canonical on mi Yoast plugin. But my home page can not be manipulated with the plugin because I think it is generated in a dynamic way. How I can solve this problem?

    Plugin Support marcanor

    (@marcanor)

    Hi @audioprolabs,

    The trailing slash in the URL is controlled by the WordPress settings. Please go to Settings -> General and check if the Site Address and WordPress Address have the trailing slash.

    If the issue persists, the canonical tag might be output by another plugin or theme and is overriding the Yoast canonical URL. To check, please perform a conflict check following the steps here.

    There might be a conflict with another plugin or your theme because looking at the source code of your homepage, we see that there are duplicate sets of tags, like the Twitter and OpenGraph tags.

    Thread Starter audioprolabs

    (@audioprolabs)

    In the word press settings the site address is without the trailing slash. The canonical URL is generated by the plugin Yoast and no another plugin. Disabling the Yoast plugin I have the following test result:
    Webpage has no canonical link tag.

    Doing a test with Health Check & Troubleshooting plugin, there is no conflict between plugins or theme. Can you provide me a code to change only the canonical URL of my home page without affecting all the other pages?

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    By default, WordPress permalinks structure use the trailing slash at the end. Can you please confirm whether your permalinks structure has the trailing slash at the end of it? You can check this from your site permalinks structure settings.

    Notice that even if your permalinks structure has no trailing slash on it, Yoast SEO will still use the trailing slash at the end of the canonical URL for your site front page URL. The front page URL always have the trailing slash at the end of this. So, if you are testing your site using a 3rd party tool, please make sure that you include the trailing slash at the end of your site URL.

    Thread Starter audioprolabs

    (@audioprolabs)

    Hello,
    my wp permalinks structure does not have at the end the trailing slash. If I include the trailing slash at the end of my site URL there in no problem using a 3rd party tools. I was thinking that the right way to write my site URL is without the trailing slash doing these tests.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    The base URL of a site will always include the trailing slash at the end of the URL and which is why Yoast SEO is adding the trailing slash at the end of the base URL only.

    Thread Starter audioprolabs

    (@audioprolabs)

    So it’s all OK, and I don’t have to worry about it?

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Right, it’s completely fine and nothing to worry about.

    Thread Starter audioprolabs

    (@audioprolabs)

    Ok, thank you very much for your help.
    best regards

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Webpage and canonical link tag points to different URLs’ is closed to new replies.