[ad_1]
Hello guys I wanted to create a WordPress on a test domain and then change it when it is done to my main domain, is that acceptable or it won’t work this way?
[ad_2]Copyright © 2020 - 2022, Project DMC - WordPress Tutorials for Beginners- All Rights Reserved. Privacy Policy
Hi! In most cases that’s absolutely acceptable and fine. When you need to switch the domain just update these 2 parameters in your wp-config.php: define( ‘WP_HOME’, ‘http://yoursiteurl.com’ );
define( ‘WP_SITEURL’, ‘http://yoursiteurl.com’ ); or via wp-admin interface. There might be some cases when this won’t work, for instance, if you have hard codes URLs for images or attachments. In that case one of the possible options is to dump your database to a file using mysqldump and replace all occurrences of the old domain using a text editor. Then you can import the new dump file and your site will be using the updated domain.
This can he done. You can either search/replace the domain name in wpconfig.php AND the database or use a plugin like this one if you’re not too confident the changes:
It’s fine but it’s a ball ache. I used to do this on subdomains of my dev server but uploading files is boring and pointless.
Building locally is faster, easier and doesn’t have any of the issues of pages being accidentally indexed by Google etc.
Use LocalWP, it will make sense.