{"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":"2026-10-30T16:05:04","modified_gmt":"2026-10-30T16:05:04","slug":"how-to-run-wordpress-database-search-and-replace","status":"publish","type":"post","link":"\/au\/tutorials\/how-to-run-wordpress-database-search-and-replace\/","title":{"rendered":"How to perform a WordPress search and replace in the database"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p class=\"wp-block-paragraph\">A WordPress database search and replace lets you find and update specific text, URLs, or other stored values across multiple database tables at once. It&rsquo;s particularly useful when changing your domain name, migrating a website, or replacing outdated information without editing each record manually.<\/p><p class=\"wp-block-paragraph\">You can perform a WordPress database search and replace using a plugin, WP-CLI via SSH, or a MySQL query in phpMyAdmin. This tutorial explains all three methods, including how to back up your database and preview changes to avoid data loss.<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-when-should-you-use-wordpress-database-search-and-replace\">When should you use WordPress database search and replace?<\/h2><p class=\"wp-block-paragraph\">WordPress database search and replace is useful when you need to update the same value across multiple database records. It&rsquo;s particularly helpful during website migrations, domain changes, and other bulk updates that would take too long to perform manually.<\/p><p class=\"wp-block-paragraph\">Common use cases include:<\/p><ul class=\"wp-block-list\">\n<li><strong>Changing your domain name.<\/strong> Replace references to an old domain with the new one in WordPress database records after a domain change.<\/li>\n\n\n\n<li><strong>Migrating a WordPress website.<\/strong> Update stored URLs when moving a website from a staging environment to a live domain or changing its address.<\/li>\n\n\n\n<li><strong>Switching from HTTP to HTTPS.<\/strong> Replace outdated HTTP URLs with HTTPS URLs to help prevent mixed-content issues after enabling SSL.<\/li>\n\n\n\n<li><strong>Updating repeated text or URLs.<\/strong> Correct outdated links, image paths, or other values stored across multiple database records.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">For changes affecting only one page or post, use the WordPress editor instead of modifying the database.<\/p><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Keep in mind that any changes made cannot be undone! You should consider <a data-click-id=\"hgr-post-content-link-backing-up-your-wordpress-site\" href=\"\/au\/tutorials\/backup-wordpress\/\">backing up your WordPress site<\/a> before making any changes in your database to prevent possible data loss.\n            <\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-what-to-do-before-running-a-wordpress-database-search-and-replace\">What to do before running a WordPress database search and replace<\/h2><p class=\"wp-block-paragraph\">Before replacing values in your WordPress database, create a backup and identify exactly what needs to change. Incorrect replacements can break links, alter website settings, or corrupt stored data. For additional safety, you can test database changes in a <a data-click-id=\"hgr-post-content-link-local-wordpress-environment\" href=\"\/au\/tutorials\/how-to-use-xampp-wordpress\/\">local WordPress environment<\/a> before applying them to your live website.<\/p><p class=\"wp-block-paragraph\">Follow these precautions:<\/p><ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Back up your database.<\/strong> Create a complete database backup so you can restore the original values if something goes wrong.<\/li>\n\n\n\n<li><strong>Identify the old and new values.<\/strong> Check the exact URLs, text, or other strings you want to replace. Pay attention to spelling, capitalization, and URL formats.<\/li>\n\n\n\n<li><strong>Run a dry run.<\/strong> If you&rsquo;re using WP-CLI or Better Search Replace, preview the changes before applying them. Review the number of matches and affected tables.<\/li>\n\n\n\n<li><strong>Protect serialized data.<\/strong> WordPress stores some settings and metadata in serialized formats. Use a serialization-aware tool such as WP-CLI or Better Search Replace for database-wide changes. Avoid raw SQL replacements on columns that may contain serialized values.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">After making the replacement, check your website&rsquo;s pages, links, images, and important settings to confirm everything works correctly.<\/p><h2 id=\"h-how-to-perform-search-and-replace-on-a-wordpress-database\" class=\"wp-block-heading h-t-title-2\">How to perform search and replace on a WordPress database?<\/h2><p class=\"wp-block-paragraph\">There are three ways to perform a search and replace on a WordPress database &mdash; using a plugin, WP-CLI via SSH, or a <a data-click-id=\"hgr-post-content-link-mysql\" href=\"\/au\/tutorials\/what-is-mysql\/\">MySQL<\/a> query.<\/p><p class=\"wp-block-paragraph\">The plugin method is ideal if you prefer a visual interface. WP-CLI works well if you have SSH access and want a single command that covers the entire database. The MySQL query gives you the most control, letting you target specific tables and fields.<\/p><h3 id=\"h-using-a-plugin\" class=\"wp-block-heading h-t-title-3\">Using a plugin<\/h3><p class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">In this tutorial, we&rsquo;re going to use <a data-click-id=\"hgr-post-content-link-better-search-replace\" href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" rel=\"noopener\">Better Search Replace<\/a>, one of the <a data-click-id=\"hgr-post-content-link-best-wordpress-plugins\" href=\"\/au\/tutorials\/best-wordpress-plugins\/\">best WordPress plugins<\/a> for this purpose.<\/p><p class=\"wp-block-paragraph\">Better Search Replace supports PHP-serialized data, lets you select specific database tables, and includes a dry-run feature to preview how many fields would be updated.<\/p><p class=\"wp-block-paragraph\">The free version includes these essential features. The Pro version adds options such as viewing individual changes, backing up and importing the database, and saving search-and-replace profiles.<\/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 data-click-id=\"hgr-post-content-link-hostinger-com-au-tutorials-wp-content-uploads-sites-2-2023-0\" href=\"https:\/\/www.hostinger.com\/au\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-plugins-addnew-bettersearchreplace-highlighted.png\"><img loading=\"lazy\" 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\/w=1024,h=1024,fit=scale-down\" alt=\"Plugins add new section on WordPress dashboard. The Install Now button near the Better Search Replace plugin is highlighted\" class=\"wp-image-81391\"  sizes=\"auto, (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 class=\"wp-block-paragraph\">In the <strong>Search\/Replace<\/strong> section, you will need to enter all of the following:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" 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\"  sizes=\"auto, (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<\/strong>: choose the database tables you want to search. Select only the relevant tables when you know where the values are stored. For site-wide URL changes, you may need to include multiple tables, including those used by plugins.<\/li>\n\n\n\n<li><strong>Replace GUIDs?<\/strong> &ndash; Leave this unchecked for a typical WordPress URL replacement. WordPress post <a data-click-id=\"hgr-post-content-link-guids\" href=\"https:\/\/deliciousbrains.com\/wordpress-post-guids-sometimes-update\/\" target=\"_blank\" rel=\"noopener\">GUIDs<\/a> are persistent identifiers and generally shouldn&rsquo;t be changed when moving a website to another domain.<\/li>\n\n\n\n<li><strong>Run as dry run?<\/strong> &ndash; Keep this option enabled for the first run. The plugin will report how many database fields would be updated without saving changes.<\/li>\n<\/ul><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">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\n<\/p><p class=\"wp-block-paragraph\">Click <strong>Run Search\/Replace<\/strong> with <strong>Run as dry run?<\/strong> enabled. Review the results to confirm the expected tables and number of changes.<\/p><p class=\"wp-block-paragraph\">If the results look correct and you&rsquo;ve backed up your database, uncheck <strong>Run as dry run?<\/strong> and click <strong>Run Search\/Replace<\/strong> again to apply the replacements.<\/p><p class=\"wp-block-paragraph\">Afterward, check the affected pages, links, and website settings to make sure everything works as expected.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a data-click-id=\"hgr-post-content-link-hostinger-com-au-tutorials-wp-content-uploads-sites-2-2023-0-2\" href=\"https:\/\/www.hostinger.com\/au\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"847\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/wpadmin-tools-bettersearchreplace-highlighted.png\/w=1024,h=1024,fit=scale-down\" 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\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p class=\"wp-block-paragraph\">If you run the plugin without the dry run option, it will immediately make changes to your database.<\/p><h3 class=\"wp-block-heading h-t-title-3\"><strong>Using WP-CLI via SSH<\/strong><\/h3><p class=\"wp-block-paragraph\"><a data-click-id=\"hgr-post-content-link-wp-cli\" href=\"\/au\/tutorials\/wp-cli\/\">WP-CLI<\/a> is a command-line tool for managing WordPress installations. Its search-replace command searches WordPress database tables without requiring you to identify individual columns. It also supports dry runs and handles PHP-serialized data safely.<\/p><p class=\"wp-block-paragraph\">This method requires SSH access and WP-CLI installed on your server. <a data-click-id=\"hgr-post-content-link-hostinger-managed-wordpress-hosting\" href=\"\/au\/wordpress-hosting\">Hostinger managed WordPress hosting<\/a> plans include both by default.<\/p><p class=\"wp-block-paragraph\">Follow these steps to run a search and replace with WP-CLI:<\/p><ol class=\"wp-block-list\">\n<li>In Hostinger dashboard, navigate to <strong>Websites<\/strong> &rarr; <strong>Dashboard<\/strong> (next to the site you want to modify) &rarr; <strong>Advanced<\/strong> &rarr; <strong>SSH Access<\/strong>.<\/li>\n\n\n\n<li>If the <strong>SSH status<\/strong> shows <strong>INACTIVE<\/strong>, click <strong>Enable<\/strong> to activate SSH access for your account.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6ae932e2f1e7f\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6ae932e2f1e7f\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-websites-advanced-ssh-access-enable-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Enable button in the SSH Access page of hPanel\" class=\"wp-image-149295\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\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>Under <strong>Log in to SSH<\/strong>, choose one of the following connection methods:\n<ul class=\"wp-block-list\">\n<li><strong>Option A &ndash; Use your device&rsquo;s terminal.<\/strong> Open Terminal (macOS\/Linux) or PowerShell (Windows), then paste the SSH command provided in Hostinger dashboard. \n<ul class=\"wp-block-list\">\n<li>For example: <code>ssh -p 65002 u123456789@185.185.185.185<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Option B &ndash; Use PuTTY.<\/strong> Open PuTTY, enter your server&rsquo;s IP address in the <strong>Host Name<\/strong> field and your SSH port in the <strong>Port<\/strong> field. Select <strong>SSH<\/strong> as the connection type, then click <strong>Open<\/strong>.\n<ul class=\"wp-block-list\">\n<li>Enter your SSH credentials when prompted to establish the connection.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol><ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Use SSH client<\/strong> &mdash; click <strong>PuTTY<\/strong> to download the client. Open PuTTY, enter the server IP in the <strong>Host Name<\/strong> field, the port in the <strong>Port<\/strong> field, select <strong>SSH<\/strong> as the connection type, and click <strong>Open<\/strong>. Enter your username and password when the terminal window appears.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">Enter your SSH password when prompted.<\/p><ol start=\"4\" class=\"wp-block-list\">\n<li>Navigate to your WordPress root directory. On Hostinger, the path follows the <strong>domains<\/strong> folder structure:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd domains\/domain.tld\/public_html<\/pre><p class=\"wp-block-paragraph\">Replace <strong>domain.tld<\/strong> with your actual domain name.<\/p><ol start=\"5\" class=\"wp-block-list\">\n<li>Run a dry run first to preview the changes without modifying the database:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wp search-replace 'old-text' 'new-text' --dry-run<\/pre><p class=\"wp-block-paragraph\">Replace <strong>old-text<\/strong> with the word or phrase you want to find, and <strong>new-text<\/strong> with its replacement. The <strong>&ndash;dry-run<\/strong> flag shows how many replacements would be made in each table without executing them.<\/p><ol start=\"6\" class=\"wp-block-list\">\n<li>Review the output. WP-CLI displays a table listing every affected database table and the number of replacements found.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6ae932e30388d\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6ae932e30388d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/terminal-wp-search-replace-dry-run.png\/w=1024,h=1024,fit=scale-down\" alt=\"The output table of the wp search-replace --dry-run command\" class=\"wp-image-149296\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\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=\"7\" class=\"wp-block-list\">\n<li>Once you&rsquo;re satisfied with the results, run the command without the <strong>&ndash;dry-run<\/strong> flag:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wp search-replace 'old-text' 'new-text'<\/pre><p class=\"wp-block-paragraph\">By default, WP-CLI searches the WordPress tables registered with <code>$wpdb<\/code>. To include additional tables that use the same WordPress database prefix, such as certain plugin-created tables, add the <code>--all-tables-with-prefix<\/code> flag:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wp search-replace 'old-text' 'new-text' --all-tables-with-prefix --dry-run<\/pre><p class=\"wp-block-paragraph\">Review the results before removing <code>--dry-run<\/code> to apply the changes.<\/p><p class=\"wp-block-paragraph\">Avoid using <code>--all-tables<\/code> unless you specifically need to modify every table in the database, including tables that don&rsquo;t belong to the current WordPress installation.<\/p><p class=\"wp-block-paragraph\">If you&rsquo;re managing a <a data-click-id=\"hgr-post-content-link-wordpress-multisite-network\" href=\"\/au\/tutorials\/activate-wordpress-multisite\/\">WordPress Multisite network<\/a>, be especially careful when selecting database tables, since individual sites have separate tables within the same database.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">WP-CLI safely handles PHP-serialized data, including values commonly stored in WordPress settings and metadata. The Better Search Replace plugin also supports serialized data, making both methods suitable for site-wide replacements.<\/p><p>Unlike these tools, direct MySQL REPLACE() queries don't account for serialized string lengths and can corrupt stored values. For domain migrations or other database-wide changes, use WP-CLI or a serialization-aware plugin instead.<\/p>\n                    <\/div>\n        \n\n\n<?xml encoding=\"utf-8\" ?><\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a data-click-id=\"hgr-post-content-link-au-cart\" aria-label=\"Cart\" class=\"hgr-tutorials-cta hgr-tutorials-cta-coupon-wordpress-hosting\" href=\"\/au\/cart?product=hosting:hostinger_business&amp;period=12&amp;coupon_cookie=WPTUTORIALS\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2025\/05\/EN_WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-128217\"  sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><\/div><h3 id=\"h-using-mysql-query\" class=\"wp-block-heading h-t-title-3\">Using MySQL query<\/h3><p class=\"wp-block-paragraph\">It&rsquo;s also possible to perform a search and replace in WordPress database using MySQL query via phpMyAdmin. <\/p><p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Direct SQL search-and-replace queries are not safe for serialized WordPress data. WordPress stores some settings, widget configurations, and other values in serialized formats that include string-length information. Changing those strings with MySQL&rsquo;s <code>REPLACE()<\/code> function can corrupt the serialized values.<\/p><p class=\"wp-block-paragraph\">Use this method only for known plain-text columns that don&rsquo;t contain serialized data. For database-wide changes, especially when changing website URLs or domains, use a serialization-aware tool such as Better Search Replace or WP-CLI instead.<\/p><p class=\"wp-block-paragraph\">Always create a database backup before running an SQL update.<\/p><p class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 Hostinger dashboard.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6ae932e30aefb\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6ae932e30aefb\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" 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--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hpanel-dashboard.png\/w=1024,h=1024,fit=scale-down\" alt=\"hPanel dashboard, highlighting access to File Manager\" class=\"wp-image-133198\"  sizes=\"auto, (max-width: 1410px) 100vw, 1410px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\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\"><figure data-wp-context='{\"imageId\":\"6ae932e3161a3\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6ae932e3161a3\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" 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--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2018\/01\/hostinger-file-manager-root.png\/w=1024,h=1024,fit=scale-down\" alt=\"Hostinger's File Manager highlighting the wp-config.php file\" class=\"wp-image-133199\"  sizes=\"auto, (max-width: 1917px) 100vw, 1917px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\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\"><figure data-wp-context='{\"imageId\":\"6ae932e31b03d\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6ae932e31b03d\" class=\"aligncenter size-full wp-lightbox-container\"><img loading=\"lazy\" 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--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-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\"  sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\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 class=\"wp-block-paragraph\">Our tutorial on <a data-click-id=\"hgr-post-content-link-finding-wordpress-database-name\" href=\"\/au\/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 class=\"wp-block-paragraph\">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 Hostinger dashboard, navigate to the <strong>Databases<\/strong> &rarr; <strong>phpMyAdmin<\/strong> section.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a data-click-id=\"hgr-post-content-link-hostinger-com-au-tutorials-wp-content-uploads-sites-2-2022-0\" href=\"https:\/\/www.hostinger.com\/au\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\"><img loading=\"lazy\" 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\"  sizes=\"auto, (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\"><figure class=\"aligncenter size-large\"><a data-click-id=\"hgr-post-content-link-hostinger-com-au-tutorials-wp-content-uploads-sites-2-2023-0-3\" href=\"https:\/\/www.hostinger.com\/au\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted.png\"><img loading=\"lazy\" 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\/w=1024,h=1024,fit=scale-down\" alt=\"The phpMyAdmin section on hPanel. The Enter phpMyAdmin button is highlighted\" class=\"wp-image-80656\"  sizes=\"auto, (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\"><figure class=\"aligncenter size-large\"><a data-click-id=\"hgr-post-content-link-au-tutorials-wp-content-uploads-sites-2-2018-01-screenshot-2\" href=\"\/au\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/01\/Screenshot-2023-01-26-at-16.58.56.png\"><img loading=\"lazy\" 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\/w=1024,h=1024,fit=scale-down\" alt=\"Navigating to the phpMyAdmin page, SQL tab at the top menu bar\" class=\"wp-image-76326\"  sizes=\"auto, (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><p class=\"wp-block-paragraph\">UPDATE TABLE_NAME<br>SET FIELD_NAME = REPLACE(FIELD_NAME, &lsquo;old-text&rsquo;, &lsquo;new-text&rsquo;)<br>WHERE FIELD_NAME LIKE &lsquo;%old-text%&rsquo;;<\/p><p class=\"wp-block-paragraph\">This query replaces matching text only within the specified column and rows. Replace <code>TABLE_NAME<\/code> and <code>FIELD_NAME<\/code> with the appropriate table and column names.<\/p><p class=\"wp-block-paragraph\">Before executing the query, confirm that the selected column contains plain-text values rather than serialized data. The <code>WHERE<\/code> clause limits which rows are updated, but it doesn&rsquo;t prevent serialized-data corruption.<\/p><p class=\"wp-block-paragraph\">Be sure to replace the placeholder texts with the correct information:<\/p><ul class=\"wp-block-list\">\n<li><strong>TABLE_NAME<\/strong> &ndash; The name of the database table you want to modify.<\/li>\n\n\n\n<li><strong>FIELD_NAME<\/strong> &ndash; The column containing the text you want to replace.<\/li>\n\n\n\n<li><strong>old-text<\/strong> &ndash; The existing word, phrase, or value you want to find.<\/li>\n\n\n\n<li><strong>new-text<\/strong> &ndash; The new word, phrase, or value that will replace it.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Once you are done writing the query, click on the <strong>Go <\/strong>button to execute it.<\/p><h2 class=\"wp-block-heading h-t-title-2\" id=\"h-what-to-do-after-a-wordpress-database-search-and-replace\">What to do after a WordPress database search and replace<\/h2><p class=\"wp-block-paragraph\">After running a search and replace in your WordPress database, check that the changes were applied correctly and your website still works as expected.<\/p><p class=\"wp-block-paragraph\">Start by reviewing the affected pages, links, images, and WordPress settings. If you changed your domain or website URLs, also check for broken links, missing images, and mixed-content warnings.<\/p><p class=\"wp-block-paragraph\">If you notice unexpected changes, restore your database from the backup you created before the replacement. You can also rerun a dry run with the original search value to check for remaining matches, but remember that some old values may be intentional.<\/p><p class=\"wp-block-paragraph\">For future database-wide updates, use a serialization-aware tool such as WP-CLI or Better Search Replace to reduce the risk of corrupting stored WordPress data.<\/p><figure class=\"wp-block-image size-large\"><a data-click-id=\"hgr-post-content-link-au-wordpress-hosting\" aria-label=\"Wordpress hosting\" class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/au\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" 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\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-111781\"  sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A WordPress database search and replace lets you find and update specific text, URLs, or other stored values across multiple database tables at once. It&rsquo;s particularly useful when changing your domain name, migrating a website, or replacing outdated information without editing each record manually. You can perform a WordPress database search and replace using a [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/au\/tutorials\/how-to-run-wordpress-database-search-and-replace\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":151887,"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":[22673],"tags":[],"class_list":["post-8069","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-run-wordpress-database-search-and-replace\/","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-localizar-e-substituir-texto-em-um-banco-de-dados-wordpress\/","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-PH","link":"https:\/\/www.hostinger.com\/ph\/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-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-run-wordpress-database-search-and-replace\/","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},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-buscar-y-reemplazar-en-base-de-datos-wordpress\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-buscar-y-reemplazar-en-base-de-datos-wordpress\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-buscar-y-reemplazar-en-base-de-datos-wordpress\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-localizar-e-substituir-texto-em-um-banco-de-dados-wordpress\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/posts\/8069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/comments?post=8069"}],"version-history":[{"count":44,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/posts\/8069\/revisions"}],"predecessor-version":[{"id":151886,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/posts\/8069\/revisions\/151886"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/media\/151887"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/media?parent=8069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/categories?post=8069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/au\/tutorials\/wp-json\/wp\/v2\/tags?post=8069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}