Change permalinks in WordPress

Since it came out at iGuRu.gr we used permalinks that contained the and the title of the publication, such as the following link:

https://iguru.gr/2021/06/06/sample-post/

Today we decided to remove the date and leave only the title of the post.

wordpress permalinks
Picture of Kinsta

Why

Because there is no reason anymore. Google used to ask for permalinks that contained the date and a random number to show the site's posts in . Later he got the random number back, and shortly after that he got the date back. The date is anyway present in the structured data of each publication.

Below we will see how you can change the type of permalinks.

You will need a coffee, and the Redirection plugin.

From the Settings / Permanent Links page (https://domain.name/wp-admin/options-permalink.php) change the links to the format you want:

screenshot 2021 06 06 16 13 50

In the case of iGuRu.gr we changed from "Day and name" to "Article name".

After the change you will have to make some changes. First the internet is full of your articles with the old links, and so in case someone clicks on a link the 404 will appear.

So install and open it Redirection plugin. You should add a redirect that will do the job for all the links that exist in the your data.

We will use regex:

Source URL: ^/\d{4}/\d{2}/\d{2}/(.*)
and
Destination URL: /$1

screenshot 2021 06 06 16 13 05

In case that te different permalink format than “Day and name” see also the following regex:

Redirect date, name, and category permalink
/ 2020/01/02 / category / post-name ⇒ / post-name /

Source URL: ^/\d{4}/\d{2}/\d{2}/.*?/(.*)
Destination URL: /$1

See above from here

Finally, before closing, let us mention that if you are using xml sitemaps, you will need to disable and enable the plugin to create new links. This will be very useful for indexing Google. If you do not do it your sitemap will contain the old links.

Caution: If you are interested in your Google ranking, do not try to change permalinks.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.082 registrants.
permalinks

Written by giorgos

George still wonders what he's doing here ...

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).