{"id":8069,"date":"2018-01-08T16:02:36","date_gmt":"2018-01-08T16:02:36","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=8069"},"modified":"2025-08-28T08:11:31","modified_gmt":"2025-08-28T08:11:31","slug":"how-to-run-wordpress-database-search-and-replace","status":"publish","type":"post","link":"\/tutorials\/how-to-run-wordpress-database-search-and-replace","title":{"rendered":"How to perform a WordPress search and replace in the database"},"content":{"rendered":"<p>Updating your database records can be time-consuming if you do it manually. Luckily, there&rsquo;s a way to update your WordPress database records in bulk. In this WordPress tutorial, we&rsquo;ll cover the tutorial on how to perform a search and replace in WordPress database with a plugin and a MySQL query.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all-in-one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-reasons-to-use-search-and-replace-on-a-wordpress-database\">Reasons to use search and replace on a WordPress database<\/h2><p>As your website depends heavily on its <a href=\"\/tutorials\/wordpress-database\">WordPress database<\/a>, it&rsquo;s essential to optimize your collection of data periodically.<\/p><p>Here are several reasons why you need to modify your WordPress database:<\/p><ul class=\"wp-block-list\">\n<li><strong>Renaming keywords<\/strong> &ndash; <a href=\"\/tutorials\/wordpress-seo-tips\">WordPress SEO<\/a> is ever-changing, and keywords that worked for your site a few months ago might not anymore. Performing search and replace can easily solve this problem for you.<\/li>\n\n\n\n<li><strong>Misspelling and typos<\/strong> &ndash; this applies to data that contains typos and grammatical errors. They happen, and searching endlessly is never fun.<\/li>\n\n\n\n<li><strong>Deleting characters<\/strong> &ndash; in some cases, WordPress updates can mess up your database by randomly adding weird characters or symbols to your data.<\/li>\n<\/ul><p>Regardless of the reason, the process of updating your database usually involves a large number of data tables. Imagine how tedious it would be to go through each table and modify the outdated data manually.<\/p><p>This is where the WordPress search and replace action comes in handy. It helps you find flawed data across database tables and modify them in no time.<\/p><p>\n\n\n<div><p class=\"important\"><strong>Important!<\/strong> Keep in mind that any changes made cannot be undone! You should consider <a href=\"\/tutorials\/backup-wordpress\">backing up your WordPress site<\/a> before making any changes in your database to prevent possible data loss.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-perform-search-and-replace-on-a-wordpress-database\">How to perform search and replace on a WordPress database?<\/h2><p>There are two ways to perform a search and replace on a WordPress database &mdash; using a plugin or a <strong><a href=\"\/tutorials\/what-is-mysql\">MySQL<\/a> query<\/strong>. Just below, we&rsquo;ll be covering both of the options.<\/p><h3 class=\"wp-block-heading\" id=\"h-using-a-plugin\">Using a plugin<\/h3><p>This method is ideal for users with no programming experience. With a plugin, you get to run a search and replace operation as many times as needed without dealing with a single line of code.<\/p><p>In this tutorial, we&rsquo;re going to use <a href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" rel=\"noopener\">Better Search Replace<\/a>, one of the <a href=\"\/tutorials\/best-wordpress-plugins\">best WordPress plugins<\/a> for this purpose.<\/p><p>Better Search Replace has plenty of useful features for managing your WordPress database. Its features besides search and replace include but are not limited to a backup creator, and database import features.<\/p><p>If you only need the search and replace function, the free version will do just fine. Should you need the rest of the features, you can upgrade to the<a href=\"https:\/\/bettersearchreplace.com\/\" target=\"_blank\" rel=\"noopener\"> Pro version<\/a> at a starting price of <strong>$59<\/strong> per year.<\/p><ol class=\"wp-block-list\">\n<li>From your WordPress admin dashboard, navigate to the <strong>Plugins<\/strong> &rarr; <strong>Add New<\/strong> section.<\/li>\n\n\n\n<li>Search for the <strong>Better Search Replace<\/strong> plugin, then select <strong>Install Now<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"473\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\/public\" alt=\"Plugins add new section on WordPress dashboard. The Install Now button near the Better Search Replace plugin is highlighted\" class=\"wp-image-81391\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"3\" class=\"wp-block-list\">\n<li>Click on the <strong>Activate<\/strong> button to activate the plugin.<\/li>\n\n\n\n<li>From your WordPress admin dashboard, navigate to the <strong>Tools<\/strong> -&gt; <strong>Better Search Replace<\/strong> section.<\/li>\n<\/ol><p>In the <strong>Search\/Replace<\/strong> section, you will need to enter all of the following:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"835\" height=\"777\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/public\" alt=\"Better Search and Replace plugin, fill in information on what to search\" class=\"wp-image-19498\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/w=835,fit=scale-down 835w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/09\/better-search-replace-plugin-3.png\/w=559,fit=scale-down 559w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/figure><\/div><ul class=\"wp-block-list\">\n<li><strong>Search for<\/strong> should have the word or phrase that you want to change.<\/li>\n\n\n\n<li><strong>Replace with<\/strong> should hold the word or phrase that will replace the original.<\/li>\n\n\n\n<li><strong>Select tables function<\/strong> lets you choose which tables of your database you want to modify.<\/li>\n\n\n\n<li><strong>Replace GUIDs?<\/strong> lets you replace the modified data&rsquo;s global unique identifier (<a href=\"https:\/\/deliciousbrains.com\/wordpress-post-guids-sometimes-update\/\" target=\"_blank\" rel=\"noopener\">GUID<\/a>) number. If your site is already live, we advise against checking this box.<\/li>\n\n\n\n<li>Tick the <strong>Run as dry run?<\/strong> box if you want to review the changes first before executing them.<\/li>\n<\/ul><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>If you want to select all the tables in the column, you can press<strong> CTRL+A<\/strong>. You can also select individual tables by holding <strong>CTRL <\/strong>and clicking one table at a time. If you want to perform a case-insensitive data search, make sure to tick the <strong>Case-Insensitive?<\/strong> box. <\/p>\n                <\/div>\n\n\n\n<\/p><p>Once you&rsquo;re done, click <strong>Run Search\/Replace<\/strong>.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"847\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/public\" alt=\"The confirmation message from the Better Search Replace plugin you will get once you have successfully run a search and replace in WordPress database.\" class=\"wp-image-81392\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>If you run the plugin without the dry run option, it will immediately make changes to your database.<\/p><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-using-mysql-query\">Using MySQL query<\/h2><p>It&rsquo;s also possible to perform a search and replace in WordPress database using MySQL query via phpMyAdmin. <\/p><p>First, we&rsquo;ll discuss how to identify your WordPress database name, which is worth reading if you have more than one database under your account. Then, we will uncover how to perform a search and replace in the database.<\/p><p>Here are the steps to locate your WordPress database name:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to the <strong>File Manager<\/strong> section from your hPanel dashboard.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69df8304d411d\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1410\" height=\"701\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/public\" alt=\"hPanel dashboard, highlighting access to File Manager\" class=\"wp-image-133198\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=1410,fit=scale-down 1410w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1410px) 100vw, 1410px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Access the <strong>public_html<\/strong> folder and double-click the <strong>wp-config.php<\/strong> file to open it.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69df8304d4f6f\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1917\" height=\"685\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/public\" alt=\"Hostinger's File Manager highlighting the wp-config.php file\" class=\"wp-image-133199\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=1917,fit=scale-down 1917w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1917px) 100vw, 1917px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Locate the <strong>DB_NAME<\/strong> value. Your WordPress database name is the value that appears next to it. In this example, the name is &ldquo;database-name-example.&rdquo;<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69df8304d5e7f\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"992\" height=\"950\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-wp-config.png\/public\" alt=\"Hostinger's File Manager editor, highlighting the database name in wp-config\" class=\"wp-image-133200\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-wp-config.png\/w=992,fit=scale-down 992w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-wp-config.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-wp-config.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-wp-config.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 992px) 100vw, 992px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Our tutorial on <a href=\"\/tutorials\/how-to-find-wordpress-database-name\">finding WordPress database name<\/a> offers more information and shows the steps using an FTP client.<\/p><p>After locating the database name, follow these steps to perform a search and replace in the database:<\/p><ol class=\"wp-block-list\">\n<li>From your hPanel dashboard, navigate to the <strong>Databases<\/strong> &rarr; <strong>phpMyAdmin<\/strong> section.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\"><img decoding=\"async\" width=\"442\" height=\"298\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\/public\" alt=\"The phpMyAdmin button in Databases section in hPanel\" class=\"wp-image-80378\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\/w=442,fit=scale-down 442w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/a><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Locate your WordPress database, then select <strong>Enter phpMyAdmin<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"427\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\/public\" alt=\"The phpMyAdmin section on hPanel. The Enter phpMyAdmin button is highlighted\" class=\"wp-image-80656\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>In the <strong>phpMyAdmin<\/strong> page, navigate to the <strong>SQL<\/strong> tab at the top menu bar.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\"><img decoding=\"async\" width=\"1024\" height=\"421\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\/public\" alt=\"Navigating to the phpMyAdmin page, SQL tab at the top menu bar\" class=\"wp-image-76326\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Add the following code snippet to the available space<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'Text to search, 'Text to replace it with');<\/pre><p>Be sure to replace the placeholder texts with the correct information:<\/p><ul class=\"wp-block-list\">\n<li><strong>TABLE_NAME<\/strong> represents the name of the table you want to modify.<\/li>\n\n\n\n<li><strong>FIELD_NAME<\/strong> represents the name of the field\/column where the targeted data resides.<\/li>\n\n\n\n<li><strong>&lsquo;Text to search&rsquo;<\/strong> contains the word or phrase that you wish to change.<\/li>\n\n\n\n<li><strong>&lsquo;Text to replace it with&rsquo;<\/strong> contains the word or phrase that will replace the previous text.<\/li>\n<\/ul><p>Once you are done writing the query, click on the <strong>Go <\/strong>button to execute it.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>To keep your WordPress website functional and up to date, you need to maintain its database periodically. The maintenance includes replacing outdated data. It&rsquo;s much easier to tackle the job in bulk with the help of WordPress search and update operation.<\/p><p>There are two methods to perform a search and update in the WordPress database:<\/p><ol class=\"wp-block-list\">\n<li><strong>Using the Better Search Replace plugin<\/strong> &ndash; suitable for users with no programming experience.<\/li>\n\n\n\n<li><strong>Using MySQL query<\/strong> &ndash; ideal for users with moderate to advanced technical knowledge.<\/li>\n<\/ol><p>Which method would you prefer? Let us know in the comment section down below!<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Learn Other Expert WordPress Techniques<\/h4>\n                    <p><a href=\"\/tutorials\/speed-up-wordpress\">How to Speed Up WordPress<\/a><br>\n<a href=\"\/tutorials\/how-to-become-wordpress-developer\">How to Become a WordPress Developer<\/a><br>\n<a href=\"\/tutorials\/wordpress-wp_query\">How to Use WordPress WP_Query<\/a><br>\n<a href=\"\/tutorials\/how-to-use-xampp-wordpress\/\">How to Use XAMPP to Set Up a Local WordPress Site<\/a><br>\n<a href=\"\/tutorials\/wordpress-custom-css\">How to Add Custom CSS to WordPress<\/a><br>\n<a href=\"\/tutorials\/activate-wordpress-multisite\">All About WordPress Multisite<\/a><\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-wordpress-search-and-replace-faq\">WordPress search and replace FAQ<\/h2><p>Here are the most common questions about WordPress search and replace.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1678184834119\"><h3 class=\"schema-faq-question\">How Do I Search and Replace Content in WordPress?<\/h3> <p class=\"schema-faq-answer\">To search and replace content in WordPress, you can use the<strong> Search &amp; Replace<\/strong> plugin, which allows you to find and replace specific text or code in your WordPress site&rsquo;s database. Alternatively, you can use a text editor or the built-in search and replace function in the WordPress code editor.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1678184875688\"><h3 class=\"schema-faq-question\">How Often Should I Search and Replace Outdated Data in WordPress?<\/h3> <p class=\"schema-faq-answer\">We recommend searching and replacing outdated data in WordPress as often as necessary, such as when updating your site&rsquo;s design, changing your domain name, or migrating your site to a new server. In addition, you can also periodically review your site&rsquo;s database to remove unnecessary data.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Updating your database records can be time-consuming if you do it manually. Luckily, there&rsquo;s a way to update your WordPress [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/tutorials\/how-to-run-wordpress-database-search-and-replace\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Run a WordPress Search and Replace in the Database","rank_math_description":"Need to update your database in bulk? Follow this WordPress tutorial to learn how to perform a search and replace in a WordPress database.","rank_math_focus_keyword":"wordpress search and replace, search and replace in wordpress","footnotes":""},"categories":[22640,22637],"tags":[],"class_list":["post-8069","post","type-post","status-publish","format-standard","hentry","category-security-and-maintenance","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-buscar-y-reemplazar-en-base-de-datos-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-search-and-replace-database-wordpress","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/agregar-meta-descripcion-wordpress-14","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-reparar-error-establishing-a-database-connection-wordpress-5\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-buscar-y-reemplazar-en-base-de-datos-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-run-wordpress-database-search-and-replace","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/8069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/comments?post=8069"}],"version-history":[{"count":40,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/8069\/revisions"}],"predecessor-version":[{"id":133203,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/8069\/revisions\/133203"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media?parent=8069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/categories?post=8069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/tags?post=8069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}