Magento 2 Get URL Without Trailing Slash in CMS Page and Block

The trailing slash at the end of the URL creates an issue of duplicate content on your website. URLs with and without trailing slash are considered as different pages by the Google search engine. Google consider these pages as 2 separate pages with the same content. In Magento 2 when you call any page in your CMS block using store URL it automatically adds a trailing slash at the end of URL. This blog post by Dhairvi Solutions helps you to know how to add URL without trailing slash in the Magento 2

How to get URL without the slash in Magento 2

Use direct_url to get URL without a slash at the end of the URL. Below is an example of how to get the About Us page URL without a trailing slash in Magento 2.

<a href="{{store direct_url='about-us'}}">About Us</a>