{"id":1,"date":"2024-04-05T01:14:54","date_gmt":"2024-04-05T01:14:54","guid":{"rendered":"http:\/\/lia.bulaong.com\/blog\/?p=1"},"modified":"2024-04-05T07:24:20","modified_gmt":"2024-04-05T02:24:20","slug":"how-to-fix-wordpress-when-changing-the-site-url-breaks-your-site","status":"publish","type":"post","link":"https:\/\/lia.bulaong.com\/blog\/2024\/04\/how-to-fix-wordpress-when-changing-the-site-url-breaks-your-site\/","title":{"rendered":"how to fix wordpress when changing the site url breaks your site"},"content":{"rendered":"\n<p>I first went online in 1995 and have posting things online ever since, first on a personal website (with a tilde in the url!) on my internet provider&#8217;s domain and then a blog in 1999 on the now-defunct cheesedip.com (runnning first on Blogger and then Movable Type) and then from 2002 on the now-defunct lliiaa.com (Movable Type). So I&#8217;ve got two and a half decades of using blogging software personally\u2014plusa handful of years of both front and back backend work on Movable Type and WordPress sites professionally\u2014and I can&#8217;t honestly remember the last time I was as fucking annoyed to have a super basic option a CMS go wrong and be unfixable for no apparent reason as I was last night, when I changed this site&#8217;s site url in the process of going live and then had it just not work no matter what. Even going in through phpMyAdmin to edit the database directly didn&#8217;t work and I was ready to tear hair out (not mine, but that of WordPress engineers cause something this simple really should just work).<\/p>\n\n\n\n<p>If you&#8217;ve arrived here because you did the same thing, you probably already have at least a few other tabs open from the same search that brought you here. I tried all those things, none of them worked for me and they were also all kinda time consuming besides. Here&#8217;s what I ended up doing which is also what I think is the most elegant solution to the problem as long as you have access to phpMyAdmin through your hosting provider.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to Tools -&gt; Export, and then export your content. I only needed to export posts, but choose the combination that makes sense for your site.<\/li>\n\n\n\n<li>Open your copy of wp-config.php and note the values it saved during your installation process for the following variables: db_name, db_user, db_password, db_host<\/li>\n\n\n\n<li>Using phpMyAdmin, access your WP install and click on your db_name in the panel on the left, so the tables listed underneath it appear on the right.<\/li>\n\n\n\n<li>Select all twelve tables; underneath them there will should be a drop-down with a handful of options. Select drop and on the next page, you&#8217;ll be asked &#8220;do you really want to execute the following query?&#8221; If you say yes, you&#8217;ll be wiping your current WP database\u2014but that&#8217;s what we want, and we backed up your content in the first step, so say yes. And now we&#8217;re done with phpMyAdmin.<\/li>\n\n\n\n<li>I moved my WP install so it now lives in the same root folder as this blog, but YMMV. Wherever is, access wp-login.php through your browser and reinstall your blog with the values you saved from wp-config.php in our second step.<\/li>\n\n\n\n<li>Go to Tools -&gt; Import, and then import the content we exported in step one.<\/li>\n<\/ol>\n\n\n\n<p>Et voil\u00e0, you should now have a working blog at the url of your choice again. Which you should&#8217;ve had all along, but hey, WordPress!<\/p>\n\n\n\n<p>Thanks to <a href=\"http:\/\/a.wholelottanothing.org\/\">Matt Haughey<\/a> for inspiring me to write this post by always putting together tutorials to save people from having to problem solve things he&#8217;s already thoroughly researched and fixed!<\/p>\n\n\n\n<p>p.s. If you found this useful, <div class=\"ko-fi-button\" data-text=\"Buy me a coffee!\" data-color=\"#ff5f5f\" data-code=\"liabulaong\" id=\"kofiShortcode846Html\" style=\"width: 100%; text-align: center;\" data-title=\"\"><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve arrived here because you did the same thing, you probably already have at least a few other tabs open from the same search that brought you here. I tried all those things, none of them worked for me and they were also all kinda time consuming besides. Here&#8217;s what I ended up doing which is also what I think is the most elegant solution to the problem as long as you have access to phpMyAdmin through your hosting provider.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":5,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":3870,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/3870"}],"wp:attachment":[{"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lia.bulaong.com\/blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}