How do I make 301 redirection from `/%post_id%/` to `/%postname%/`?
I’ve written my own solution, sharing it and hoping it will help someone. Add this to your functions.php: <?php add_action(‘parse_request’, ‘redirect_postid_to_postname’); function redirect_postid_to_postname($wp) { // If /%post_id%/ if (is_numeric($wp->request)) { $post_id = $wp->request; $slug = get_post_field( ‘post_name’, $post_id ); // If the post slug === the post number, prevent redirection loops. if ($slug !== $post_id) … Read more