AVADA logo
Published on

How to build URLs on your site in Shopify

873 words5 min read
  • Name

As a shop owner, you must really concern about the way to SEO your site effectively. The first step you can do this is that you need to set up URLs to make it friendly with the search engine.

Firstly, here come some useful information I prepared about the URLs. Simply, they are clear addresses that users access the online resources stored on the Internet. They play an important role in SEO because if you have an ideal URL, there will be a larger amount of audiences visit your site.

I would like to give you some tips to have search engine friendly URLs to drive more and more users to your site. They should not have unnecessary words but the content of the article. In addition, it must be the most concise and not be too long. Remember to leave unnecessary words. Each word in the URL is separated by a dash “-“. If you’ve known all of above, the rest will tell about how to build URLs on your site. To configure the best URLs, you should set up permalink on your site.

Below is a clear guide for you to take steps.

Table of content

For example, if we have a page called /blog.html, we want it on the live site to be /blog/. We could carry out what we expect by creating a new folder named blog. Then, you move blog.html to that folder and change its name into index.html. Afterward, move /blog/index.html back to /blog.html. Add a permalink in the front matter and specify the URL we expect by the code below:

layout: default
title: Blog
permalink: /blog/

As /blog/ now outputs the blog page, you just need to go to blog.html in the browser 404s.

It would be such a waste of time when you have to set a permalink to every blog post. There’s a solution for this. You just need to set it for all blog posts at once in _config.yml. You can use the variables available while setting permalinks for posts. They are year, month, i_month, short_year, hour, etc. You can see them more details in the following table.

yearYear from the Post’s filename.
monthMonth from the Post’s filename.
i_monthMonth from the Post’s filename without leading zeros.
dayDay from the Post’s filename.
i_dayDay from the Post’s filename without leading zeros.
short_yearYear from the Post’s filename without the century.
hourHour of the day, 24-hour clock, zero-padded from the post’s date front matter. (00..23)
minuteMinute of the hour from the post’s date front matter. (00..59)
secondSecond of the minute from the post’s date front matter. (00..59)
titleTitle from the document’s filename. May be overridden via the document’s slug YAML front matter.
slugSlugified title from the document’s filename (any character except numbers and letters is replaced as hyphen). May be overridden via the document’s slug YAML front matter.
categoriesThe specified categories for this Post. If a post has multiple categories, Jekyll will create a hierarchy (e.g. /category1/category2). Also Jekyll automatically parses out double slashes in the URLs, so if no categories are present, it will ignore this.

Here is the code you can use to create the permalink the day, the month, the year respectively by the title of the post.

permalink: /:day/:month/:year/:title/

Similar to set the permalinks to blog posts, when you set them to collections, there are variables available such as collection, path, name, title and output_ext. You can take advantage of the table below to know more variables.

collectionLabel of the containing collection.
pathPath to the document relative to the collection's directory.
nameThe document's base filename, with every sequence of spaces and non-alphanumeric characters replaced by a hyphen.
titleThe document's lowercase title (as defined in its front matter), with every sequence of spaces and non-alphanumeric characters replaced by a hyphen. If the document does not define a title in its front matter, this is equivalent to name.
output_extExtension of the output file.

You can set permalinks to metadata of the collection in _config.yml by adding the code:

    output: true
    permalink: /baked-goods/:path/

As you can see, it now links to /bake-goods/afghan/ instead of /cookies/afghan/.


In a nutshell, that you know how to build URLs on your site is such a great way to SEO your site easily. Hope your site has more and more positive visitors by the search engine friendly URLs you created. If you find this instruction works, visit more helpful writings we write.

Exclusive Offer: Shopify Deal for PageFly Audience

Start Your Online Business with Shopify 12 Day Free Trial + Pay Only 1$ For Your First Month

Exclusive Offer: The Online Store Starter Kit

Get the Shopify Free Trial plus the premium package designed especially for new Shopify merchants - all for FREE!

What’s in it for you?

  • The Shopify free trial
  • Ecommerce CRO checklist: set up a high-converting Shopify store - with over 300+ checkpoints to boost your conversion rate, AOV, and more (value)
  • Enjoy 2 months free on all AVADA paid apps (value)
  • Exclusive discounts on top-rated Shopify apps and themes + Additional perks (value)

How can I get it?

The Online Store Starter Kit will be delivered to your email after signing up for Shopify using the custom landing page Shopify made for AVADA’s audience. There’s no additional cost for you!

Start your Shopify Free Trial now and get it for free!

img Advertisement