What is WordPress Permalinks and How to Change it?

Permalink is the term used in WordPress to indicate an URL where the content is stored permanently. This is used to generate pretty clean URLs for blog post and pages in WordPress. Permalink is an optional feature but highly famous and recommended among WordPress community for SEO and user friendly reasons. Each page created in WordPress site is stored as a permanent URL which is identified with the running number. This is called ugly URL since it is not possible for both search engines and users to get any information regarding the content on the page.

In order to overcome this WordPress has a feature called permalinks to change the ugly URL to a pretty looking one. If enabled, URL of the page will be generated with descriptive words from the title of the page (or as per the permalinks settings). This helps to make the URL human readable and user friendly.

How to Find Permanent URL of WordPress Page?

When a post is created in WordPress, it is stored and accessible using a permanent URL “http://example.com/?p1”, where p1 indicates the post 1 created in a site “example.com”. You can find the post number on the browser address bar when creating or editing the post.

Finding Ugly Link of a Page in WordPress
Finding Ugly Link of a Page in WordPress

If permalinks structure is enabled to use a custom structure as post name then the post will be used in a pretty URL like “http://example.com/post-title/”. The permalink can be viewed under the post title as shown below:

Viewing Permalink of a Page
Viewing Permalink of a Page

How to Enable Permalinks for New Site?

Login to your WordPress admin dashboard and navigate to “Settings > Permalinks”. WordPress allows the following options for setting URL of your site.

WordPress Permalinks Settings
WordPress Permalink Settings

Below table explains the options with examples:

Permalinks OptionDescriptionExample
DefaultDefault option will show the ugly link with post number.http://example.com/?p=123
Day and nameInclude the complete date in the post URL.http://example.com/2016/10/26/post-title/
Month and nameInclude month and year in the post URL.http://example.com/2016/10/post-title/
NumericSimilar to default but only include the post number.http://example.com/archives/123
Post nameAdd post title as URL.http://example.com/post-title/
Custom StructureAny custom structure to define the URL. For example, you can add the post name using /%postname%/.http://example.com/post-title/

How Permalinks Work in WordPress?

When permalinks is enabled in a site, the ugly permanent URLs are forwarded to pretty URLs by means of redirect set in .htaccess file. WordPress creates the following entries in .htaccess file using “mod_rewrite” module of Apache server.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php 
# END WordPress

Thus in order to enable permalinks you should have permission to modify .htaccess file.

Permalinks will stop working if .htaccess file entries are removed or corrupted, just disable and enable permalink settings from WordPress admin panel to create the required entries again. Learn more about permalinks issues and solutions in WordPress.

Why You Should Enable Permalinks?

The simple reason to enable permalinks is to offer user friendly URLs. This helps users to remember the page URL and directly access the page when required. Also the descriptive URLs help to link the content and the URL more closely.

On other hand pretty URLs will improve the SEO of the pages. For example, the page with the URL “http://example.com/?123” showing on search results will attract fewer clicks than the page with the URL “http://example.com/post-title”. Also you can add the keywords of the page in URL to improve the on-page SEO.

Changing Permalink Structure of Existing Site

Permalinks are to be enabled when the site is launched newly. There are many reasons one may look for changing the permalink structure of a site.

  • You may be using the default ugly links and want to change to “post name” to improve SEO.
  • You may be using date structure but the content is not bounded to the date. Hence you want to change the structure to the one not limited to the time.

The general and recommended structure is to use “Post name” option. This will just suffix the post title to the site name to create a page URL.

If you are looking for changing the URL structure of a live WordPress then ensure to setup 301 redirects from old URL to new URL. You can do this using Redirection plugin or adding directives in .htaccess file.

Yoast Redirect Generation Tool

If you want to convert your permalinks structure to “post name” then Yoast has a tool for this. It is called permalinks helper and generates .htaccess directive when changing permalinks structure of the URLs. You can provide the old URL and choose the existing permalinks structure to get the redirect for new permalinks with “/%postname%/” structure.

Yoast Redirect Helper for Permalinks Change
Yoast Redirect Helper for Permalinks Change

Steps Involved in Changing Permalinks Structure

Below are the steps involved in changing permalinks structure of an existing WordPress site:

  • Download all existing URLs from your XML Sitemap.
  • Change the new permalinks structure from WordPress admin dashboard under “Settings > Permalinks”
  • Setup 301 redirects using plugin or using .htaccess directive.
  • Generate new XML Sitemap with new URL structure.
  • Resubmit your XML Sitemap to Google and other search engines.

It may take some time for search engines to replace the old URLs with new URLs in search results.

Editorial Staff at WebNots are team members who love to build websites and share the learning with webmasters community. Follow us on Facebook and Twitter.

Leave a Comment