how change url permalink in wordpress database by sql query

I transfer WordPress website from localhost to live but there some url and images url not changes, how can change URL permalink in WordPress database by sql query or any other method.

I use below sql query but anythings not happen please help me…

Read More
UPDATE Wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Thanks in advance

Related posts

1 comment

  1. Here is a link to an article from the official wordpress.org page, it covers most of the url changing topic.
    It shows the several diverent ways how to do it and also the sql way via phpmyadmin. The raw sql is not shown, but there are several methodes.

    In this Blog post a very simple way is described.

    I copied the relevant sql statments from the blog post:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
    

    This should change the Url’s easy

Comments are closed.