L
L
looooser2018-09-16 21:24:31
SQL
looooser, 2018-09-16 21:24:31

How to change the name of a wordpress site?

The site is located on the local machine on Openserver and has the name of the folder in which it is located. Please tell me how can I change the name of this folder.
In phpmyadmin I write the following queries:

UPDATE wp_options 
SET option_value = REPLACE(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') 
WHERE option_name = 'home' OR option_name = 'siteurl'; 

UPDATE wp_posts 
SET guid = REPLACE(guid, 'http://www.oldsite.com','http://www.newsite.com');  

UPDATE wp_posts 
SET post_content = REPLACE(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');

Requests are executed, lines are changed, but when accessed by a new name, redirection to the old folder name occurs and an error pops up. I didn’t do something, I guess)
I apologize to those who spent their time on this, I feel I forgot to do something trivial.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-09-16
@azerphoenix

Hello!
Install the plugin Better Search Replace Enter the name of the folder into the search, replace it with the working url... select all tables, check the guid as well and uncheck the test run and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question