OK, so let’s assume you have these URLs in some array (if you don’t, you can easily prepare it using any developer text editor, I guess). Let’s call that array $slugs
and let’s say it’s defined like so:
$slugs = array(
'customer-name' => 'google-customer-name',
...
);
So there are only slugs in there.
So now you’ll have to modify the posts:
global $wpdb;
foreach ( $slugs as $old => $new ) {
$wpdb->update(
$wpdb->posts,
array( 'post_name' => $new ),
array( 'post_name' => $old )
);
}
This will change the slugs, hence the permalinks, for these posts.
Related Posts:
- Stop WordPress appending `-2` to the end of my url after i change it
- WordPress Permalinks not working in Apache2 Ubuntu 14.04
- Get current URL (permalink) without /page/{pagenum}/
- Removing Parent Page(s) from Permalink
- Removing the redirect after changing a page’s slug
- How to display a public profile page for registered users with custom slug?
- Page begins with number, WordPress adds 2
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- nginx – permalinks with .php in url not working
- Include Taxonomy slug in post url
- Nice RSS Feed URLs for each custom post type
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Rewrite url / permalink for default archive – yearly / monthly
- Should I use relative or absolute urls when pointing to internal pages
- removed index.php now all pages 404
- How can I change permalinks to use a different domain and path from where the blog is hosted?
- Gutenberg Editor: dynamicaly change slug field with an ACF field
- Permalinks all messed up, I am helpless [closed]
- Permalinks, Rewrites, Get Variables, Oh My!
- WordPress | Convert #038; to &
- Can’t get rewrite rules working
- permalink changed, now getting 404 for every pages
- How to write correct add_rewrite_rule in WordPress for more than one taxonomy in one rule?
- When is it a good idea to build a permalink structure from scratch?
- Permalinks not working Apache + CentOS 7
- How can I link a file in admin with a button?
- Remove Dash/Hyphen From WordPress CustomPosttype Permalink
- Auto-create a pretty permalink for a bunch of posts
- How to show the homepage on a different url, like site.com/blog instead of site.com?
- Post incorrectly displaying as page
- wp_logout_url redirects to incorrect page because of pagination
- why does my url not update after migration?
- Dynamically create Permalinks for uploaded files?
- Get new WordPress slug from old wordpress slug
- Moved page (new parent) loads properly using obsolete URI. Why?
- Rewrite rule for a query string
- Custom Permalinks for Posts only
- How to add a variable as a tag base?
- Is it possible for a custom post type and sub pages of a page with the same slug as the custom post type to share a slug?
- Why is page/2/ not working?
- Removing leading zeros from custom permalink structure
- Integrating wordpress into existing site and setting up htaccess?
- Permalinks stopped working – NO update, mod_rewrite enabled, .htaccess not touched
- Add more structure tag to permalink?
- wp_publish_post to saved draft, permalinks broken
- display dynamic content based on url slug on custom page
- How to generate a list of all urls
- Default permalink changes
- Slugs Disappeared Leaving 404s – Quick way to repopulate?
- Path to Pages Resolves to Archive instead of Actual Content
- permalink %year% of pre-written posts to be published next year, in the mysterious future (*)
- Changing permalink name redirects to another template?
- Permalink slug no longer editable when using post_type_link filter
- How can I emulate permalink behaviour on static pages
- add_query_vars and canonical links
- Changing the permlink and SEO
- whats the mistake → href=”get_permalink() [closed]
- Remove some rewrite rules in wordpress
- Media/attachment urls don’t redirect with fake URL structure
- How to change permalinks
- How can I link to the author’s page
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- Would it be wrong to save the permalinks as a postmeta and regenerate it on save post? [closed]
- How to: change permalink by category?
- Passing variable as permalink URL
- new page redirect to old page which had the same permalink
- Edit permalink for old posts and not show on top of RSS feed
- “set_front” => false on custom post type breaks wp_list_categories links [closed]
- Customizing a permalink
- Long permalinks get split with multidots and get broken
- Page content doesn’t display when published but does when previewed as draft?
- Will permalinks work if blog is transferred to subdirectory?
- function to set permalink to /%postname%/ on theme activation
- How to remove slug from front page?
- Find all URLs for a post
- WordPress keeps removing query var from the URL
- Homepage template and url changed?
- Multiple URL rewrite rules and get every prams
- Passing parameter through permalink structure
- Add word to permalinks does not transform the urls
- Prevent 301 when a trailing slash added
- Why I had to re-save permalink setting after moving my WordPress site to another hosting provider?
- Permalinks custom base to redirect to archive.php
- How to change URL of my pages?
- get_permalink to an anchor
- Pretty permalinks returning “not found” on localhost and server
- Removing or hiding slug/permalink from htaccess
- WordPress Permalink Problem
- Converting WP Page to use full explicit paths?
- Add Custom Pagination Permalink
- Prevent guessing slug
- Pages included in another page and duplicate content issues for SEO
- WordPress archive posts returns user to homepage
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- Permalink issues with Ubuntu Server – Infinite loop & Wrong pages
- How can i edit all posts slug in bulk keeping WP native redirect?
- Post/page without slug
- Blog url disappears
- Standard Htaccess directives disappear by themselves
- My permalinks no longer have the “news” category prefix in the link and it’s causing 404 errors for articles published on the web