Change WordPress URL

0
(0)

Change website URL and links in wordpress database

WordPress conversions and migration require several steps to customize the URL. Setting the WordPress address is in a new installation, under Settings General for WordPress address (URL) and web page address (URL). Further changes are required for migration and URL changes.

Modify WordPress-Aaddress URL using phpMyAdmin

During migration, access to the WP-Admin may be blocked, after that has already been changed the A Record or CNAME in DNS, also the virtual host configuration on the Web server. The URL also needs to be changed when switching the page from Dev to Live. At this point, the website address and the links in the content can be changed with phpMyAdmin.

Change WordPress address (URL) and website address (URL) to phpMyAdmin

To change the WordPress address and website address in phpMyAdmin, you open the database and go to View, in the now opened tree you select the table wp_options, on the left search for siteurl and home in the column option_name, here Edit and modify the value in the field option_value with the new URL and click OK to confirm.

Illustration: phpMyAdmin

Note: The WordPress default database prefix is wp_, at this point where the prefix was previously changed to wp_futbg5.

If you want to search the database for text, go to Search after opening the database and enter the search argument integrated between % characters. In this case, the developer environment should be made the live page, where dev.artemis.org the developer is URL, and www.artemis.org the live URL of the page.

phpMyAdmin Browsing the Database

In the table(s) click on Select All, followed by OK. As a rule, the hits in the tables are wp_posts and wp_postmeta to be found in the field post_content.

In phpMyAdmin the URL can change by using the following SQL command to Find Replace the tables.

UPDATE wp_posts
SET guid =REPLACE(
    Guid
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_posts
SET post_content = REPLACE(
    post_content,
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_postmeta
SET meta_value = REPLACE(
    meta_value,
    "dev.artemis.org,"
    "www.artemis.org"
);

UPDATE wp_links
SET link_url = REPLACE(
    link_url,
    "dev.artemis.org,"
    "www.artemis.org"
);

If plugins are used that contain tables with URLs, the content must be changed here.

UPDATE table name
SET field_with_url = REPLACE(
    field_with_url,
    "dev.artemis.org,"
    "www.artemis.org"
);

Instead of the placeholder table name and field_with_url enter the actual table name, the relevant plugins with the tables can be found with text search in phpMyAdmin as described above.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Leave a Reply

Your email address will not be published. Required fields are marked *