A URL (Uniform Resource Locator) is the unique web address used to access specific resources from internet-connected websites. It instructs browsers on how and where to find a website page or resource (i.e. an image). In the context of Onpage Optimisation, Page URL Slug Optimisation is limited to the optimisation of the last section or Slug of the URL identifying a landing page.
However, a wholistic URL Optimisation process is also concerned with URL Structure Optimisation, part of technical SEO and including various aspects outside the scope of Page URL Slug Optimisation:
Table of Contents
Page URL Slugs are used by search engines to determine what landing pages to show for what keywords. So above all, the Page URL Slug must be descriptive of the landing page it represents and in line with the Page Title and Meta Description for that page. Similarly, the choice of what keywords to use for what URL Slugs must be driven by the same Keyword Research process across all Onpage elements.
You should consider such Keyword Metrics as Organic Rankings, Search Volume, Keyword Difficulty, Click-through Rate and Traffic Potential to make judgements on what keywords to give preference to over others. In the case of two similar URL options, all things being equal, the version featuring the most important keywords at the beginning of the Page Slug should be preferred to that featuring them at the end.
Optimising Page URL Slugs in WordPress
As outlined, there are quite a number of things to consider when optimising URLs, but URL structure is mostly set up once and then reused across your publishing. There is one single thing that you will have to optimise every time you publish a new Page or Post and that is the Page Slug or the last Slug of the URL, part of the URL path.
Editing the URL Slug in WordPress
You can specify the URL Slug using the default Page Settings. Open the Page or Post Settings on the right-side of your Top Toolbar and find “Slug“.
Once you edit the URL Slug, you will seee how it fits within the Permalink, which will also show the other elements of the URL.
- Protocol
- Canonical domain
- Domain name
- Top-Level Domain
- Any Parent Pages

You can also edit the URL Slug using the “Quick Edit” feature on the “All Pages” or “All Posts“. Just find the Page or Post > “Quick Edit‘ > Slug.

Employing the RankMath SEO plugin for editing URL Slugs
RankMath allows editing the URL Slug along a Preview of the URL as seen in the Google SERPs. This is useful for writing URLs of just the right length and testing them right in the editing window.
Installing Rankmath
After you’ve installed the Rankmath SEO plugin, you will need to click the Rankmath icon in the top-right corner of your view. Upon click, your Rankmath editor will likely appear below your content field the first time around. It is recommended to drag it to the top-right corner of your screen from below the content editing area.
Specifying the URL Slug using Rankmath directly in the Page or Post view
Visit the Page or Post you want to specify the URL for.
- Click on the “RankMath” icon in the top right corner to see the following panel.
- The “General” tab is pre-selected by default and will display your current URL (if any) alongside your Page Title and Meta Description, the way they’re visible in Google Search.
- Click “Edit Snippet” to open the “Preview Snippet Editor” which will allow you to edit your URL Slug.


As you make edits, the RankMath Preview section will display in real-time how your URL will look like in Google SERPs. This presents a great opportunity to ensure your URL is of the right length.
If you specified target keywords within the “Focus Keyword” section of Rankmath, these will be highlighted in bold for URLs as well as Page Titles and Meta Descriptions, exactly the way you would expect for them to be highlighted in Google Search when users search for those particular keywords.
The last URL Slug you have specified, either in WordPress’ default Slug input field or Rankmath’s Permalink input field, will overwrite what you have specified earlier using any of the two methods.
Case-Sensitivity in URLs
URLs Paths, including Page URL Slugs are case-sensitive, meaning a URL Slug with one uppercase letter is a different URL than exactly the same URL with the same letter in lowercase.
Despite uppercase letters generally being allowed in URL Slugs, WordPress applies certain URL sanitisation rules, which will automatically convert all uppercase letters to lowercase to prevent duplicate issues caused by case-sensitivity being handled differently across systems.
Hyphens versus Underscores in URLs
URL Paths, including the Page URL Slug support both, Hyphens [-] and Underscores. However, the hyphen [-] is the only recommended option for filling-in space between words. The reason behind this is that at the moment the major search engines are programmed to read the hyphens [-] as word separators, while the underscores [_] as a means of combining words. As far as search engines are concerned, the use of underscores [_] is now discouraged altogether.
Furthermore, WordPress URL Sanitisation automatically converts the blank spaces in the URL slug field into hyphens [-].
Non-English Characters in URLs
The use of non-English characters in the URLs of non-English websites is allowed and in case of Page URL Slugs, encouraged.
Even though non-English characters require encoding, browsers and search engines typically display international characters as decoded. Also, most search engines can recognise, crawl and rank landing pages based on the keywords containing such international characters. So, if one expects users to search for keywords containing non-English characters, it is only normal to make appropriate use of them in URLs.
Lastly, it may be worth noting the WordPress URL sanitisation rules will automatically convert latin alphabet characters with diacritics [á] into the standard English characters without diacritics [a]. At the same time, it will automatically use appropriate encoding for the characters from all other alphabets. The encoded characters of non-English languages are typically decoded and displayed normally in both browsers and search engines and their encoded URL segments are only revealed when copied to clipboard.
Optimal URL lengths
From a technical point of view, URLs must be shorter than 2,083 characters in order to correctly render in all browsers. For URLs to display fully in Google SERPs, as opposed to it being truncated, its length should be within the limits of 512 pixels. The actual number of characters will, of course, vary as some characters spread over more pixels than others. A general estimate for URLs to fully display in SERPs would fall at around 50 to 60 characters.
It is generally advised to keep URLs as short as possible, providing just enough information to both users and search engines to understand the content of the landing page and its structural context in relation to the rest of the website.
- Avoid using superfluous words that do not add immediate value to the content, like prepositions (in, on, at) and conjunctions (for, and, or).
- Avoid the repetition of keywords that are already present in the subdirectories of the URL path.
- Keep the length of Page Slug within three words for it to remain usable by users who are likely to rely on it to make decisions about your landing page.
There is a negative correlation between the length of a URL and organic search rankings, meaning that all things being equal, shorter URLs are likely to rank higher in organic search results.
Reserved Characters in URLs
When it comes to URLs, not all characters are born equal. It begins with a group called Unreserved Characters: alphanumerics (a-z and 0-9) and a small number of additional special characters including the hyphen [-] used to separate words, the underscore [_] traditionally used to combine words, the dot [.] and the almost equals sign [~].
On the other end, there are Reserved Characters, which have a reserved technical purpose within a URL. Their presence in a specific part of the URL has the technical capacity to change its semantics. The full list of reserved characters include: ! * ‘ ( ) ; : @ & = + $ , / ? % # [ ]. If your input these characters in your URL slug, the WordPress URL Sanitisation feature will automaticall remove them.
The Forward Slash [/] reserved purpose
The character with arguably the most important reserved purpose in URLs is the forward-slash [/], used on subdirectories [/subdirectory/]. In simple terms, forward slashes [/] enable all URLs to be part of a hierarchy, by delimiting separate entities on a website from each other.
Do not use the forward slash [/] to create subdirectories through the URL Slug Field. As subdirectories are designed to hold multiple pages under the, they need to first be created independently of the page. Only then, can you select a subdirectory through the “Parent” input field under “Page Settings“.
The Hash Sign [#] reserved purpose
An important feature in URLs is triggered by the use of hashes [#], which normally indicates not only the location of the page but also a specific location within the page itself, such as a header or the beginning of a paragraph on that page. This is particularly useful for information-heavy websites, which may require to accommodate hyperlinks to specific paragraphs or sections of text as opposed to the entire landing page.
For this reason, the use of hashes can only be used for this purpose and this purpose alone. The content of such URLs with hashes [#] in them is not indexed, as the content is considered to already be part of the larger web page (held by the URL without the hash [#]).