Overview
Permanent links (or, permalinks) are the full URLs of posts and pages on a WordPress site. There are different structures available for permalinks, but all will, at minimum, include the domain name and a slug (the piece of the URL that comes after the domain name). Some examples include:
- www.example.com/category/yourcategory
- www.example.com/home
- www.example.com/shop
- www.example.com/blog/yourblog/
These permalinks are primarily used for sharing specific posts and pages on your site, such as linking to your content or sharing it on social media, or indexing your site through search engines such as Google.
Resetting and configuring permalinks
When changes are made to the WordPress that affect the permalink structure (such as migrations, importing page/post content, or adding posts through plugins or code), you will need to save your permalinks again to refresh them. The following steps explain two methods of refreshing the permalinks and rewrite rules.
Via WordPress admin dashboard
- Log in to your domain’s WordPress dashboard.
- In your panel, navigate to Settings > Permalinks.
- Click Save Changes.
Via SSH
- Log in to your server via SSH.
- Navigate to your WordPress directory.
- Run the following command.
[server]$ wp rewrite flush
Setting up SEO-friendly URLs
SEO-friendly URLs are easily readable by both humans and search engines. In WordPress, this is typically done by using the Post name permalink structure. Since the release of WordPress 4.2, WordPress uses Post name structure by default. The following steps explain how to edit the permalink structure to be SEO-friendly if it is not currently:
Permalinks can be safely saved/refreshed. However, changing the permalink structure of an existing site can cause it to lose "social media share count" and may result in the site losing SEO ranking.
If you need to update the permalink structure to improve SEO, you will still lose your social share count, but the benefits will outweigh the loss in the long term.
- Log in to your domain’s WordPress dashboard.
- In your panel, navigate to Settings > Permalinks.
- Using the radio buttons, select the Post name option.
- Click Save Changes.