This piece of PHP code will mass change your WordPress slug links to default slugs WordPress would normally generate from your article titles.
Open wp-config.php, add the following at the bottom:
Save and upload your new wp-config.php and load your home page only one time. Once the loading is completed, remove the code from your wp-config.php file.
Credits: Clorith @ https://github.com/Clorith/wp-slug-update
Thank you for the code. Worked well on my custom posts by changing:
WHERE
`post_type` = ‘page’
OR
`post_type` = ‘post’
TO
WHERE
`post_type` = ‘custom-post-type’
This saved my day, thanks.
For those wondering, it works like a charm even for translated posts (at least if using WPML).
Thank You So Much!!! Worked Like A charm!!!
This really worked like a charm!… perfect!…
for those who are dealing with WooCommerce products *only*, such was my case, change the following code:
From:
=====
WHERE
`post_type` = ‘page’
OR
`post_type` = ‘post’
To become:
==========
WHERE
`post_type` = ‘product’
hope this helps for others.