• Resolved Attila Bogozi

    (@waaab)


    As the title suggest I am trying to remove the trailing slash from my homepage canonical.

    • Settings General -> WordPress Address (URL) -> domain name with no trailing slash
    • Settings General -> Site Address (URL) -> domain name with no trailing slash
    • Settings Reading -> Your homepage displays -> Your latest posts

      I have tried this method but it doesn’t work for me:
      https://www.ads-software.com/support/topic/want-to-remove-the-trailing-slash-at-the-end-of-my-canonical-urls/

      Why not allow users to configure their own canonical for the homepage if the home is set to display the latest posts?
      Any ideas how I can remove it before I dig into the code?

      Thanks

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

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

    (@maybellyne)

    Hello @waaab

    Thanks for using the Yoast SEO plugin. The plugin is not responsible for the trailing slash in your canonical URL. So if you want to remove it, it has to be done site-wide.

    Thread Starter Attila Bogozi

    (@waaab)

    Hello. I am not sure what to think now.
    It is clearly visible in the html code of my blog that the canonical is added by the Yoast plugin.
    Please check again, or view the screenshot I’ve added to this reply.

    1. Yoast is the only SEO plugin installed.
    2. If I would add the canonical manually, or any other plugin would do it, the canonical tag wouldn’t have the class=”yoast-meta-tag” attached to it for sure. ??
    3. My general settings, as described above have no trailing slash in URLs.
    Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @waaab

    Would you kindly let us know why you would like to remove the trailing slash from the homepage canonical? Are you facing any issues due to this? Can you kindly elaborate more on the issue you are facing due to the trailing slash for your homepage canonical?

    Thread Starter Attila Bogozi

    (@waaab)

    Hi. As described above my main URL is without trailing slash, and I want my canonical to be consistent, especially on my homepage.
    Once again, I want to take out the training slash only from my homepage URL, the inner pages do have trailing slash and those are ok.

    Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @waaab

    The Yoast SEO plugin code documents the available developer filters for customizing many of our plugin features. We also have a developer portal with more information about filters and many examples of how to implement them.

    We recommend creating regular backups of your site and database for your site’s health and safety. A backup is crucial before modifying the code?and provides you with a safety net if something were to go wrong. Learn more about the?benefits of regular backups.

    You or your developer can use the wpseo_canonical filter to customize the homepage canonical URL and remove the trailing slash. Typically code snippets are added to your theme’s functions.php file. If you’re unfamiliar with using code snippets, we’d like to refer you to the WordPress documentation on how to use a filter.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.