I love to use this tool, Search and Replace for WordPress Databases. It is basically a PHP script that is written for WordPress usage (but of course can be used with any database). When placed in the WordPress project, it automatically detects and loads the Database using data from wp-config.php
file.
It enables you to make database queries based on regex, with a ‘dry runs’ – you will see a preview of the data that will be changed, but no real changes would be made. Also, it is serialization aware, meaning, if the variable you are replacing is inside a serialized object, it will safely be replaced, without breaking the serialization.
Setup is easy, just drop the folder in the WP root, and navigate the browser to the main PHP file. Remember to remove it afterwards.
I think you will love it as well, but remember to backup and double check before any live runs.
Related Posts:
- Manually removing revision post types
- Reset/Reorder posts ID in the MySQL wp_posts table
- How do I find which articles are missing a featured image in The WordPress database?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Restore woocommerce orders
- How to select particular month post from table and update the post status using MySQL?
- Bulk find & replace on WordPress posts/pages (minus image paths)
- SQL trigger failes with post_content
- Converting Posts to Pages
- How to change the publishing date of each posts?
- Can posts have parents?
- Where is the old post permalink slug stored?
- Separate Database Tables For Different Post Types
- MySQL Query to Retrieve Category from wp_posts
- SQL Query for getting all posts in their latest revised state
- How are terms connected with posts in database?
- Moving WordPress to new server: no posts found
- Search & Remove Specific Shortcode From All Posts
- Manually delete post from database
- How to force update all posts after import
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Query All users that has post
- Exporting Data from WordPress into a flat table
- Can’t publish new posts
- Insert posts in two tables
- Instead of submiting an entire post, is there any way to submit a lite-post or a simple message?
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Split WP_POST table based on post types
- Most recent post from another database
- What structure should post_content have in the database?
- How to delete all the content of a wordpress site without deleting the Post and pages?
- How to modify post content?
- wp_insert_post – duration
- After database migration, posts not showing up in dashboard
- Transferring WordPress Database – Serialised data
- Emojis replaced by ‘?’ automatically
- WordPress Local And Live Site
- Custom order for Mysql array
- wp_posts table: safely remove unused columns to save database storage
- Anyone know why wordpress converts some html entities to their numeric equivalents?
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- Delete post results in “Cannot delete or update a parent row: a foreign key constraint fails”
- Is it possible to use WP_Query to only pull posts with attachments?
- Get posts and include taxonomy term
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Add field to user meta table in database when link is clicked
- How safe is it to delete old posts edits to save database space?
- Delete post revisions only for a single post
- wp_posts table extremely large
- How to Assign / Move all Deleted post to a category
- Display post number by category
- Saving Post Data in Another Database
- Queries take 120+ seconds on my large WordPress site
- Database hacked – random posts are modified
- Need to change all links in page content but not in post content
- How do post IDs work in WordPress?
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Update field in database for users
- Import custom database into wp and keep the post id
- get last post’s link with SQL query
- Moved to a new server, backup was a day old and missing 3 posts, anyway to recover them from old host?
- query for filtering published posts?
- Help on conditional statement to accompany wp_insert_post function please?
- How can I globally italicize list of texts in the UI database or Posts? [closed]
- Is it possible to modify posts table to only read for more recent ones?
- WP query taxonomy optimization
- Menu Items disappearing/being empty on save or post edit
- Query to fetch custom taxonomy along with post title
- How to setup default value of post_id
- Mysql update menu_order problem
- Prevent a post with a specific ID from being created
- Reusing old post IDs
- Trigger on DB make problem on wordpress?
- WordPress MySQL Search and replace with wildcard?
- Comments are in database, don’t show up in WordPress backend or frontend
- Is there a way to save different data when USER interacts with the same POST?
- Add postmeta to all blog posts
- ‘posts’ table should not store the absolute image path
- Dev and prod on the same database- dev version active for IOS
- load post data into mysql
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- how i show manual data in a post
- Clean up customize_changeset in DB
- Maximum number of posts per page before affecting performance?
- get backup file from wordpress database in x days
- I moved my site to another server, wp admin works so does the front page, but posts don’t work
- Can’t seem to replicate permalink structure for localhost development site
- When I click edit on a post, all the content disappear. Does anyone know how to fix this?
- SQL query to remove first image in all posts
- Given two custom post types: Automatically add meta fields from one custom post type to another
- Delete junk text from all the post using my sql command
- How to create a post based on data in a table?
- Is there a maximum amount of pages for a multi-page post?
- If meta_key exists then don’t select this post?
- How to make category for word post_content
- How can I merge a several related posts into one post?
- Restore posts, but only posts that exist in my database backup
- Change permalinks in posts via SQL