Page rules with wordpress permalinks


Hi there! I am not quite sure how these page links work. I want here)/*
to redirect to:$1

so for an example.
redirects to

How can I make it remove the date?


You can try the following but I wouldnt be surprised if it didnt work*/*/*/*

If that doesnt work you would probably have to look into workers. I’d suggest doing it server-side though.


Yeah this is what I tried at first but it did not work :confused:

I guess I could always try something like this on the nginx server

RedirectMatch 301 ^/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+)/$$4

I just tried it with a demo page rule and it should actually work. Post a screenshot of your page rule.



In that case you will take the year. You want to refer to the fourth asterisk which is $4 then.

1 Like



Okay I changed it. Although it might take some time to update NOPE works :smiley:


That is probably because of the trailing slash. You might need another page rule but I cant guarantee that you will get this to work. Server-side is probably still the best choice.


rewrite “/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)”$5 permanent; from - I believe this will work for nginx rewrite. I will just try this instead when I get home :smiley: Thank you for the help anyways!


You can try Redirection, an excellent free plugin with which you can set your regular expression redirects. It allows you to write redirects to your .htaccess file.

The formula /*/*/*/*/, even if it worked with or without the trailing slash, could be problematic, as WordPress generates all kinds of archive and paginated pages that might result in something like: being redirected to and that would be a 404!

1 Like
closed #14

This topic was automatically closed after 31 days. New replies are no longer allowed.