Bulk update post slugs through database

Try this query, remembering to change out your_posts_table with the proper name in your database. Using CONCAT, you can add any number of strings, just pass post_name to add your changes before/after.

update your_posts_table
set post_name = CONCAT('pre-', post_name)
  • More info on MySQL CONCAT
  • Note: Use a WHERE clause if you only want to update specific posts.

tech