<input type="hidden" id="_wpnonce" name="_wpnonce" value="0f153c9372" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/333" /><input type="hidden" id="_wpnonce" name="_wpnonce" value="0f153c9372" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/333" />{"id":333,"date":"2012-02-26T12:46:38","date_gmt":"2012-02-26T12:46:38","guid":{"rendered":"https:\/\/www.businesslegions.com\/blog\/?p=333"},"modified":"2012-02-26T12:46:38","modified_gmt":"2012-02-26T12:46:38","slug":"wordpress-problem-when-moving-folders","status":"publish","type":"post","link":"https:\/\/www.businesslegions.com\/blog\/2012\/02\/26\/wordpress-problem-when-moving-folders\/","title":{"rendered":"WordPress problem when moving folders"},"content":{"rendered":"<!--CusAds0--><p>&nbsp;<\/p>\n<p>I tried moving my WordPress folder to the root of my hosting account and things went pear shaped. After some debugging, I noticed that in the database stored the URL of the website. This meant I had to change most of the data entries in the database. I knew nothing about SQL queries but after some research I managed to find some code that was able to change my domain URL and here it is:<\/p>\n<blockquote>\n<pre><code>UPDATE wp_options SET option_value = replace(option_value, 'http:\/\/olddomain.com', 'http:\/\/newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';\r\n\r\nUPDATE wp_posts SET guid = replace(guid, 'http:\/\/olddomain.com','http:\/\/newdomain.com');\r\n\r\nUPDATE wp_posts SET post_content = replace(post_content, 'http:\/\/olddomain.com', 'http:\/\/newdomain.com');\r\n\r\nUPDATE wp_postmeta SET meta_value = replace(meta_value, 'http:\/\/olddomain.com', 'http:\/\/newdomain.com');<\/code><\/pre>\n<\/blockquote>\n<div class=\"lt-box\" style=\"border:1px solid #1d6a9e\"><div class=\"lt-box-title\" style=\"background-color:#2485C6;border-top:1px solid #a7cee8;text-shadow:1px 1px 0 #0b283b\">DO YOU LIKE WHAT YOU'VE READ?<\/div><div class=\"lt-box-content\">Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!\r\n\r\n<p><div class=\"tnp tnp-subscription \">\n<form method=\"post\" action=\"https:\/\/www.businesslegions.com\/blog\/wp-admin\/admin-ajax.php?action=tnp&amp;na=s\">\n<input type=\"hidden\" name=\"nlang\" value=\"\">\n<div class=\"tnp-field tnp-field-firstname\"><label for=\"tnp-1\">Name<\/label>\n<input class=\"tnp-name\" type=\"text\" name=\"nn\" id=\"tnp-1\" value=\"\" placeholder=\"\"><\/div>\n<div class=\"tnp-field tnp-field-email\"><label for=\"tnp-2\">Email<\/label>\n<input class=\"tnp-email\" type=\"email\" name=\"ne\" id=\"tnp-2\" value=\"\" placeholder=\"\" required><\/div>\n<div class=\"tnp-field tnp-field-button\" style=\"text-align: left\"><input class=\"tnp-submit\" type=\"submit\" value=\"Subscribe\" style=\"\">\n<\/div>\n<\/form>\n<\/div>\n<\/p>\r\n\r\n<\/div><\/div><!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>&nbsp; I tried moving my WordPress folder to the root of my hosting account and things went pear shaped. After some debugging, I noticed that in the database stored the URL of the website. This meant I had to change most of the data entries in the database. I knew nothing about SQL queries but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[498,495,502,503,493,225,403,500,486,487,496,494,277,485,501,499,490,1936,488],"class_list":["post-333","post","type-post","status-publish","format-standard","hentry","category-technology","tag-data-entries","tag-debugging","tag-domain","tag-domain-url","tag-folders","tag-home","tag-meta","tag-name","tag-option-name","tag-option-value","tag-pear","tag-root","tag-set","tag-siteurl","tag-sql-queries","tag-update","tag-where","tag-wordpress","tag-wp"],"_links":{"self":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":1,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/333\/revisions"}],"predecessor-version":[{"id":334,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/333\/revisions\/334"}],"wp:attachment":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/media?parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/categories?post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/tags?post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}