{"id":712,"date":"2016-07-20T08:39:18","date_gmt":"2016-07-20T07:39:18","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=712"},"modified":"2016-07-20T08:39:18","modified_gmt":"2016-07-20T07:39:18","slug":"discovering-siteurl-variable-wordpress","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/07\/20\/discovering-siteurl-variable-wordpress\/","title":{"rendered":"Discovering siteurl variable for WordPress"},"content":{"rendered":"<p>So I recently read a little piece by one of my colleagues about this. It comes up fairly frequently so it&#8217;s worth mentioning. It&#8217;s possible to determine the address that wordpress is using as the siteurl by directly querying the database or looking for the value in the sql dump.<\/p>\n<pre>\r\nDatabase changed\r\nmysql> SELECT option_name,option_value FROM wp_options WHERE option_name='siteurl';\r\n+-------------+---------------------------------------+\r\n| option_name | option_value                          |\r\n+-------------+---------------------------------------+\r\n| siteurl     | http:\/\/mywordpresssite.com\/ |\r\n+-------------+---------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\n<\/pre>\n<p>It turns out there is a second &#8216;home&#8217; page variable in the database:<\/p>\n<pre>\r\nmysql> SELECT option_name,option_value FROM wp_options WHERE option_name='home';\r\n+-------------+---------------------------------------+\r\n| option_name | option_value                          |\r\n+-------------+---------------------------------------+\r\n| home        | http:\/\/mywordpresssite.com\/test |\r\n+-------------+---------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\n<\/pre>\n<p>I&#8217;m not 100% on the difference between &#8216;siteurl&#8217; and &#8216;home&#8217;, but guessing the siteurl is the tld definition of the domain, and home is the default landing page for requests to that TLD. As I understand it anyway, I am sure someone will correct me if this isn&#8217;t completely correct.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I recently read a little piece by one of my colleagues about this. It comes up fairly frequently so it&#8217;s worth mentioning. It&#8217;s possible to determine the address that wordpress is using as the siteurl by directly querying the &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/07\/20\/discovering-siteurl-variable-wordpress\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,7,2,16],"tags":[],"class_list":["post-712","post","type-post","status-publish","format-standard","hentry","category-cms","category-management-tools","category-mysql","category-wordpress"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=712"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/712\/revisions"}],"predecessor-version":[{"id":713,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/712\/revisions\/713"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}