The most efficient way to accomplish this would be to change the structure to /%postname%/
and add a 301 redirect to your .htaccess file for the old structure:
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$3
Change example.com
to your domain and add the redirect above the # BEGIN WordPress
directive so it won’t be removed if WordPress updates the file.
EDIT- redirect /yyyy/mm/dd/postname
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$4
Related Posts:
- Use subdomain for certain urls
- Using WordPress with Apache behind an nginx reverse proxy
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- Change pagination url format
- How to redirect specific URL to Subdomain
- How to redirect a link to a new link?
- Can’t get pretty permalinks to work without index.php
- WP-Include rewrite directory
- Configuring Apache for localhost
- Rewrite Slug for CPT Archive Pages to Plural Name of Slug
- Change author base slug for different roles
- How to add custom rewrite rule to .htaccess?
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Custom Permalinks for Blog Posts Only
- Detect page type by url (Archive, single, page, author,…)
- How to show the same content on multiple URLs?
- Using a page template without a page
- How to seamlessly redirect between different archive and singular slugs?
- Overwrite rewrite-slug of built in post-type ‘post’
- Why does wordpress still strip my query var?
- URL rewrites and pagination
- Rewrite rules goes away
- Rewrite Rule for Post “Subpage”, with pagination
- unexpected problem in url rewrite
- Need to make a php file inside theme accessible via url
- Remove child category from URL
- Rewrite loading custom template file but is_home() returns true, and there’s no 404
- Rewrite rule for admin-ajax.php
- Removing the post format (type) slug
- Redirect all posts urls from without .html to .html
- WordPress rewrite rules for state and city
- Single Redirection Rule for Pages and Archive links
- Home page with Polylang redirects to other page [closed]
- expecting 404 but redirecting to post with url subdirectory in post title
- Custom user profile URLs
- Rewrite of URL with ‘[‘ ‘]’ or ‘(‘ ‘)’ as literals
- Define orderby in url
- Changing RSS feed URL structure
- Preserve Domain Alias
- Mobile version issue when domain forwarding with masking
- How to building pretty URLs to reflect category hierarchy?
- WordPress Rewrites – How can I pass a variable to Custom Post Type?
- Need to add rewrite rule that adds in additional information about the post to url
- add_rewrite_rule is redirecting instead of rewriting url
- Rewrite rules automatically for pages using specific template
- Add language prefix to permalinks
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Attachment page gives 404 if user not logged
- Rewrites: .htaccess or wp_rewrite for bulk 301 changes?
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- How to pass url as a parameter in a add_rewrite_rule
- Per Page Permalink Structure for Page Post Type
- Customise particular RSS permalink
- RSS feed rewrite matching wrong rule
- Removing “www” from a site URL
- Replace “http://localhost:8888/” by website URL in WordPress
- Custom rewrite rule not working
- Thousands of 404 errors on old posts due to embedded links
- WP Rewrite for a custom variable
- Creating a folder structure
- How to Detect That WP is Using Mod Rewrite or $_GET variables?
- Can’t use a specific custom URL (slug)?
- How do I get posts to appear at mydomain.com/blog?
- rewrite rules and capturing
- Adding the amp url prefix to the beginning
- How to change search page url so that it still returns a page when there’s no search query specified?
- Custom taxonomy named ‘tag’ return 404 page
- How to redirect to a login virtual page?
- Multiple permalink with and without category for same post
- Custom Params in URL
- Help adding custom url, rewrite_rules_array
- Implementing geotargeting while using a single database
- Url rewrite, add rule, redirect as POST request?
- Broken page redirect
- Add query arg for pretty permalinks in wordpress way
- Homepage cannot be found
- How to add 2 variable rewrite rule?
- Get custom posts by segment of the URL
- Add ReWrite from Old Pages to WordPress (remove .php)
- Remove trailing slash
- Rewrite Url to a SEO-friendly format
- Use Parent Pages for URL Structure without Landing Page
- add_rewrite Rule
- How to show my application as referral in WordPress Stats
- Fully mask *all* traces of WordPress installation subdirectory?
- Appending parameters to WordPress query string in backend
- rewrite rule of post when accessed from archives pages
- Redirect A URL Pattern In WordPress Using .htaccess
- Help to cleanup this code
- Rewrite Question
- Change the search URL
- How to make a custom route with any-string-part/number-part pointing to an existing page?
- username in rewritten URL, howto use it in a template
- Rewwrite rule for mapping plugin static file
- Listing Authors – URL Formats [duplicate]
- wordpress url rewrite Query Var to Static url
- Add rewrite endpoint and .htaccess
- Remove url parameter using wordpress
- Rewrite rule to simulate page hierarchy results in 404
- add_rewrite_rule not working with custom variables