I have installed a new wp site and I have imported on it a database of an already built site. Now I need to change the wp_option table to change the url because it keeps taking me to the old url. My problem is that I don’t understand the way the wp_option table is displayed in the database, it is not the same way it is displayed in phpmyadmin of a normal commercial server, where I can modify option_name and siteurl (which is not displayed in this database) . What do I need to change to be able to modify the url and redirect the path to localwp? Maybe it’s very simple, but I’m confused. Thank you very much.
Troubleshooting Questions
Does this happen for all sites in Local, or just one in particular? Only one.
Are you able to create a new, plain WordPress site in Local and access it in a Browser?
I can install a new site in localwp bit is my first time to import a pre-build- site.
Replication
Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!
@Gabriela, it looks like you’ve clicked on the link that takes you to the structure of the table, and that you’re trying to modify that. I think what you want is to click on the link to the left of the table name (in your case, “registros”). That will show you the data in the table, and allow you to edit it. Clicking on the name of the table in Adminer allows you to view the table’s structure.
That said, you may also find a plugin like WP Migrate (or Better Search and Replace) to be a better tool to search and replace the hostname/URL throughout the database, as opposed to manually working through the database tables (wp_options is only one place where the URL ends up in the data). I only mention WP Migrate as the first suggestion as it is incredibly useful for this purpose, but offers so much more in the migration of WP sites.
Thanks, my problem is that the site always redirects me to the original url, so I can’t access the local site’s wordpress admin, such as to install Better Search Replace which is a plugin. With your instructions (look in “registros”, thanks!) now I tried to change the url in wp_option, but the system won’t let me, so I’m really lost and I don’t know what I’m doing wrong.
I’m not sure why the system won’t let you update the value via Adminer. There are a number of other options that you could try – of course, replace the URL with that of your site, and make sure that URL matches the one set in Local for the site.
If you’re having issues editing the value directly within Adminer, you could try running SQL to perform the update – something like:
update wp_options set option_value = 'https://example.com' where option_name = 'siteurl'; update wp_options set option_value = 'https://example.com' where option_name = 'home';
Modify the SQL file before re-importing it via Adminer.
Add something like this to your theme’s functions.php file and try loading the site:
It’s going to be better to get those database entries correct. The last one won’t touch the database, but uses a little brute force to override the database entries.