0

I have a HUGE pet peeve with Wordpress that honestly drives me crazy. Everytime you move the website, you have to go into the database in the new environment, and change in the table wp_options the "siteurl" and the "home".

This is extremely annyoing. I wish that my "moving" procedure would be as simple as:

  1. Copy file tree
  2. Copy database
  3. Done

Is there a way to circumvent this?

0

For the specific settings you are asking about you can hardcode the values into your wp-config.php file(s):

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

These values will be used and database values will be ignored and not editable in settings.

Note that there are plenty more places that might store URLs, such as images in content and so on. There are solutions around that specialize in migrations and/or replacing data in WP database. Those would be more robust in this regard than making it a manual-ish process.

  • Well, here I have the same problem. I have to still change this variables, but not in the database but in the files. It is just a little more convenient, but not really a solution. – Enrique Moreno Tent Sep 6 '14 at 14:42
  • @Dbugger the point is that you can do this in config file, how can be different from manual editing. You can do it based conditionally on the domain of the request, etc. – Rarst Sep 6 '14 at 14:54
  • Aha, so you mean take the domain of the request, and add it to the define? That is not a bad idea. I will think about how implementing that – Enrique Moreno Tent Sep 6 '14 at 14:59
  • Weird. changing that doesnt work on functions like bloginfo() – Enrique Moreno Tent Sep 6 '14 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.