I changed the permalink structure from /%category%/%postname%/ to /%year%/%monthnum%/%postname%//

How can I redirect all old posts to the new ones (eg: via htaccess)?

2 Answers
2

WordPress should handle the 301 redirects for you automatically in this case. It doesn’t always, but it should here.

Long story short, WordPress has a function, redirect_guess_404_permalink which tries to find the correct post when it encounters a 404 by using the end of the 404 url to query against the wp_posts.post_name. If it finds a post, it will perform a 301 redirect. In your particular case, because your old structure ends in %postname%, this should very reliably 301 all your old paths.

Leave a Reply

Your email address will not be published. Required fields are marked *