Here’s a tip I picked up on the WordPress hackers’ list: you can change the “siteurl” WordPress option simply by adding define('RELOCATE',true); to the wp-config.php file and browsing to wp-login.php.
The “siteurl” option—or what’s called “WordPress address” under the admin options menu—is a database value that refers to where the actual WordPress files live, as opposed to where the site appears to be, which is the “home” option (called “Blog address” in the options panel).
For example, if I have my site located at www.ilfilosofo.com, it would be easier to keep track of WordPress files, manage upgrades, etc., if I were to put all the files in a sub-directory, say www.ilfilosofo.com/wp. Everything would still appear at www.ilfilosofo.com (the “home” setting), but the files would actually be at www.ilfilosofo.com/wp (the “siteurl” setting). Normally you’d have to edit the database to do this, and it’s something I do a lot.
(Note that contra the hackers list, this resets only the “siteurl” option, not the “home” option.)
Since I’m frequently editing the database just to change the “siteurl” and “home” options, what I’d really like is to be able to set them in wp-config.php. Lead WP developer Matt Mullenweg has suggested something similar, so I submitted a patch with the hopes of getting this feature into a future version of WordPress.
5 Comments
hi filosofo! great tip. can you help me in this case: i have a blog (with all contents, images, pages, posts) in domaindotcom/blog
i want to change the url for this project to
domaindotcom/site
what is the correct and easiest way to do that? what more i need to do? i must uploads all the files to the new ‘site’ dir? sorry for my english.
thanks a lot!
hi filosofo. can you return me about this case above… thanks!
It depends on whether in your posts you link to stuff in /blog/. If not, you can just add the WP_SITEURL and WP_HOME constants in your wp-config.php file.
Otherwise, you might need to do a search and replace in the database itself or in the sql dump of your database.
hi
how are you!!
my question is the following
i intaklled a theme on my website on a temporaily website of mine in WORDPRESS untill i registered the name and domain, now i added pictures and all the information etc onto that temp website..
i have now bought the domain and what i did is on the cpanel i copied and pasted all the files and themes onto the new domain ok?? but now what i want to do is manage to change the following
1: when i type in the site all is ok, but when i eg go to see pages the temp website details appears at the top on the http:// THE TEMP WEBSITE DETAILS APPEARS… and it looks so unprofessional as the customers thinks they in the wrong website.. please advise me on what can be done as i do not wnat to re introduce all the pictures and information again onto the new domain
can u help
awaiting your advise
thz jack
pS the site is http://www.edinburghtours.com is on underconstruction so you will not be able too see the page changes at the top when one changes too see a dif page http://
Hi, I can’t get into my dashboard or even my cpanel(from the web host). the site’s live but trying the wp-login.php route brings me a blank page. Please what can Ido??? Help
3 Trackbacks
[...] filosofo for the fix, implemented in [...]
[...] so much to filosofo for this fix. Like [...]
[...] so much to filosofo and WordPress.org for sharing this [...]