You’ll find this post by Joost De Valk on changing WordPress permalinks to only include /%postname%
very helpful.
How many posts you have doesn’t matter anymore if you are using the latest version of WordPress (at least > v3.3.1).
I believe your permalink structure initially was — this /blog/%year%/%monthnum%/%day%/%postname%/
— and now, you are planning to use a much simpler one — /%postname%/
— amirite?
If the above is true, you just have to add this rule to your .htaccess file, and it should take care of all the 301 redirects for you:
RedirectMatch 301 ^/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+)/$ http://www.thedomain.com/$4
And since it’s a 301 redirect, yes, Google will eventually know that the post has been moved to a new URL.
EDIT: By the way, the redirect rule doesn’t require mod_rewrite
. It uses mod_alias
which is enabled by default by most (if not almost all) hosts.
Related Posts:
- remove “index.php” from permalinks
- “.#[random-char-string]” being inserted at end of URLs
- Pretty Permalinks
- How to map permalinks with accented letters to sanitized slugs?
- add new permalink structure from dynamic page
- Force wordpress to display page with same url structure as categories
- How to remove specific category from URL in WordPress
- mod-rewrite exception? keep #hash in matching urls?
- Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)
- Access posts while mod_rewrite is broken
- Permalink not changing according to post type
- How can I put WordPress in a directory but keep just the home page at the domain root?
- how to create several url aliases for a page
- How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
- Permalink format: singular or plural
- Pretty permalinks for search results with extra query var
- What is the best permalink structure for SEO?
- Custom post type permalink endpoint
- Using $_GET variables in the URL?
- Including category-base in a post permalink results in 404
- WordPress thinks my custom route is a 404
- Filtering categories in the permalink structure
- Multiple post categories – single permalink
- Update URL Snippet to Canonical Permalink URL
- How to prevent the default home rewrite to a static page
- How do I turn off 301 redirecting posts (not canonical)?
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- Remove parent slug for child pages
- Without index.php in permalinks I get 404 across site
- How can I Rewrite a ‘page’ URL based on query string parameters?
- Pros and cons of using [taxonomy name] in place of [category name]?
- custom naming of search permalink /search/
- Rewrite user profile URL to be human friendly
- Random Alphanumeric Key URLs
- Using WP rather than .htaccess to redirect pages/posts
- Rewrite URL for results of a custom WP_Query
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- custom permalink/shortlink with base62 encoded post ID
- Change permalinks with ACF values
- template_include not loading -instead goes to index.php
- Call to a member function add_rule() on a non-object
- Custom taxonomy rewrite using tax name instead of rewrite slug
- I need a custom permalink for my website
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Add custom post type name in term link?
- add_rewrite_rule not working for me
- Using WP Rewrite, but just not “getting it”
- Share same Slug for a Custom Post Type and 2 Taxonomies
- Rewrite CPT permalinks and include WPML language
- Redirect a Blogger Page URL to wordpress
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- IIS 7 Rewrite with parent categories
- Do WordPress Permalinks Refer to a Lookup Table in the Database?
- 404 error using Meta for Permalink rewrite
- Permalinks only for posts
- Changing permalinks structure without loosing SEO
- How to handle paging/pagination with a custom permalink?
- .htaccess rewriterule being ignored – tyring to remove dates from WP posts
- Visiting posts results in 404 errors after host migration
- Can’t get permalinks working!
- Custom URL rewrites for templates
- How to change custom post type, blog post and page permalink by template?
- Custom permalink structure with %postname% in front of domain name
- How can I set up a secondary permalink structure?
- How to get raw unwritten querystring
- mod-rewrite rules grabs “broken permalinks”, too
- How to Use metada Value in Url and is it possible? [duplicate]
- Need to capture “keyword” added to the end of the post, even with “pretty permalinks”
- How do I rewrite attachment urls when permalink structure contains %category%?
- Custom child page permalink
- Safest way to create a custom permalink
- Creating an alternate path for a page
- Is it possible to change the permalink structure without changing the old permalinks to posts and without 301 redirects?
- How to change URL from /%postname%/ to custom-name/%category%/%year%/%monthnum%/%day%/%postname%/
- Adding a ‘blogs’ prefix in the URL structure but only for blogs
- WordPress Attachment Page URL Rewrite!
- WP permalink working, but why content doesn’t display
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Redirect page to homepage, keeping URL
- Updates all internal links on permalink update
- how to have same rewrite rules for 2 different post type?
- Permalink structure /page/page/cpt-post gives 404 with pagination
- What permastrusture tags are generated out of the box right after creating custom post types and taxonomies?
- Rewrite posts url as they’re all children of a page
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- How to change permalink structure and keep permalinks for old posts
- Search and replace post URL’s on page output?
- Dynamically populate permalinks
- Two urls for one website
- Once redirected by Rewrite rules, how can WordPress know the page?
- WordPress permalink still not working (error or not understood?)
- Only homepage working correctly, 404 error on everything else
- Custom Permalink Base
- customize urls displayed by previous_post_link and next_post_link
- My wordpress site must be being affected by outside sources [duplicate]
- How to shorten the Permalink after WP>WP blog import?
- Permalinks, how to show them in post
- Blog URL Structure – Multiple Taxonomies