Customize WordPress URL structure (static path)
- 24-07-2022
- chuong xuan
- 0 Comments
- Lesson number: 13
- Year of implementation: 2021
- Belonging to the project: A Beginner's Guide to Using WordPress
This part may sound a bit technical, but it's not that difficult. And yes, the topic is a bit boring but you have to pay attention because URL structure affects SEO, as well as the possibility of it being shared on social networks or linked by other pages (you have backlinks).
You should set up the correct URL structure from the beginning, or in case you are negligent, don't let the situation of writing hundreds of new articles decide to change the URL structure because then it will be quite difficult to fix. cure. In addition, if the editing is not skillful, it will also destroy your SEO efforts.
Okay, no more circling.
By default, this is the WordPress URL structure:
http://1wp.abc.com/2021/09/27/ban-nhap-tieu-de-bai-viet-o-day/
You won't need to care about the first part: http://1wp.abc.com this is the domain name & nothing will change in that part.
The URL structure I mean is here: 2021/09/27/ban-nhap-tieu-de-bai-viet-o-day/
You can see this is the structure year/month/day/url-crawl-bai-viet
There are 2 top important criteria in the canonical URL structure, which are:
- It needs to be brief
- It is descriptive
Looking at the criteria on the default WordPress structure, 2 things go wrong:
- It gives too much information to the reader, since the date information in the URL is hardly useful to the reader in most types of articles.
- Even the date in the URL can backfire if the reader thinks the article is too old and unsuitable to read (when it may not be).
Mục lục
1. OK understood, so what structure should I use now?
There are currently two common constructs in use:
- Prioritize maximum brevity, domain-name/post-name , like: abc.com/nghien-cuu-wordpress
- Short but still paying attention to the directory, put the directory in the URL, domain-name/directory/article-name , like: abc.com/seo/nghien-cuu-wordpress; where seo (SEO) is the directory
The above structures all ignore the date, in fact some websites still use the May or even dateMay structure but that is not much, and the websites that actively use that structure all have a reason. their. , for example they have a lot of daily posts, May structure helps them to limit duplicate URLs.
Going back a bit to the 2 common structures, the maximum concise structure seems easy to understand, but what about the structure with the directory? What is its advantage?
In terms of providing information to the reader, the bibliographic structure helps the viewer know which major bibliography the article is reading in. In terms of marketing, the directory structure makes it easy for advertisers to set up remarketing for people who have already visited the site.
There is only a small note in the URL structure with directories that you should not let the directory name be too long, 1 word is best, not a maximum of 2 words. That helps you avoid destroying your brief advantage.
2. WordPress Template URL Restructuring
This is the practice part, after you have understood the theory that I presented above.
The first is to set up an overview of the URL pattern (static path). You look to the left hand side of the Dashboard (message board).
With Vietnamese WordPress, go to Settings > Static Paths
For English WordPress, go to Settings > Permalinks
You can see a lot of options for setting up a static path (sample URL structure):
You only need to care about the last one, Custom Structure because this is where we customize the URL structure to our liking.
If you're following the shortest URL possible, copy the following in the blank: /%postname%/
If you are following the URL direction with the directory, copy the following into the empty box: /%category%/%postname%/
Where category means directory, and postname means post name.
To save the settings, scroll to the bottom and press Save Changes
3. Edit the article URL when necessary
The above part is to set up the overall sample URL of the articles, when necessary you should rewrite the specific URL of an article, that is the postname part.
Why is that, because every time youwrite a new post , when you give the post a title, WordPress automatically generates a post title for that post, it's pretty good but sometimes it's not optimized for length and sometimes keywords are also missing.
For example, the auto-generated postal name for the post itself has the following name: Tuy-chinh-cau-truc-url-cua-wordpress-duong-dan-tinh
It is up to 10 words, long, in most cases you should limit it to only 5 words.
To edit this URL, click the Edit button just below the title:
Then you choose only the most important keywords, for example I choose this: cau-truc-url-wordpress
A small note is that if you have not selected a folder for the article while writing an article, it will automatically classify that article as uncategorized (that is, uncategorized) as above.
To edit a folder, in the Categories area, select a new folder, and then click Save Draft:
In the end you will have the desired structure:
Above is the URL structure with directories.
If that was the maximum concise URL structure, it would look like this:
So you have understood and know how to do both parts related to setting up the overall URL structure of the whole page and editing the URL of each specific post as needed.
P / S: if you use the Yoast SEO plugin to optimize for search engines, when the URL is too long, there will be a message telling you that:
4. Disadvantages of 2 common URL structures
We already know their advantages, the above URL structures keep URLs short, look good and get a lot of benefits from this.
However, they are not without their drawbacks.
With its super-short URL structure, only postal names, no directories, it's best suited for content-intensive, narrow, multi-topic pages that would struggle (mainly on the lossy side). effort) if you want to set up selections based on directory URLs, best examples of remarketing (like Facebook Remarketing or the Google display network).
With the URL structure attached to the directory, you will be in trouble if you change the article to another directory, or rename the directory, because that if not careful can lead to the URL of the article being changed. But changing URLs that don't work will sabotage your SEO. At this point you will need to set up a (301) redirect to make sure the search engines recognize the new but old URL to keep your website ranking.
In case you categorize an article in two different directories at the same time, only one directory is selected as the primary directory and that directory name will appear in the URL as a URL with the directory.
Now that all needs to be said, I wish you a nice URL.
P/S: I'm choosing the super short URL structure myself.