Categories: Linux

CHANGE WORDPRESS DOMAIN USING HTTP://WP-CLI.ORG/

&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2522 " id&equals;"quads-ad2522" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<p>These are instructions that demonstrate how to change WordPress to match your replaced or changed Public domain&period; as this occurs in case if you are already using WordPress and have it published on let&&num;8217&semi;s say Domain1&period;com and then you transferred this domain to Domain2&period;com&period;<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2531 " id&equals;"quads-ad2531" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2526 " id&equals;"quads-ad2526" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2523 " id&equals;"quads-ad2523" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p>When you try to reach wordpress website from your new public domain&period; you might not reach it or wordpress might try to redirect you to your old domain1&period;com instead&period; <&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>In order to fix this&comma; we&&num;8217&semi;ll have to use a tool called wp-cli which fixes this configuration problem&period; to do so please open your SSH shell or get in your UBuntu server and do the following&period; <&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<ol class&equals;"wp-block-list"><li>sudo curl -O <a href&equals;"https&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;https&percnt;3A&percnt;2F&percnt;2Fraw&period;githubusercontent&period;com&percnt;2Fwp-cli&percnt;2Fbuilds&percnt;2Fgh-pages&percnt;2Fphar&percnt;2Fwp-cli&period;phar&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNFiLT6qX91I3zjNx-GwJh6CkZGwbg" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">https&colon;&sol;&sol;raw&period;githubusercontent&period;com&sol;wp-cli&sol;builds&sol;gh-pages&sol;phar&sol;wp-cli&period;phar<&sol;a><&sol;li><&sol;ol>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image001&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNGfvqq9x19WZFs76mVoedYdD&lowbar;eqJQ" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;XRS48-KMIZxfrrRM108LXekxSJDAdZkJMIkQl9vTEB34XdNCk3vq7tXJMEnPr8NLpIZG8YUhKY95EGU3VtUXmjcB-aYHw2lMQsTDr-j7UwbsB47hqA&equals;w673" alt&equals;"clip&lowbar;image001"&sol;><&sol;a> &NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2525 " id&equals;"quads-ad2525" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; &NewLine;<&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p> 2&period; From User&commat;UbuntuServer&colon;&sol;var&sol;www&sol;html&dollar; I will run the following command to make sure that the command is working<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>sudo php wp-cli&period;phar –info<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image002&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNGbWIplBheAxFoLJwDMFnhfM2H12w" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;oWM0lubUC2McfAjrT7-gFri41Rq-PW&lowbar;0CM0CQ4NZ7dH3YoFfOfXbT-t7y1mIdXQSmi5oBr&lowbar;GFx2lhONdXT&lowbar;nIz6UTl38dUj5xmCUT4c&lowbar;S5JCZxQ-K5Y&equals;w673" alt&equals;"clip&lowbar;image002"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p> 3&period; I’ll move the file to a new path and location so I can access it from anywhere using only the command WP&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>First I will give the required permissions<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>moh10ly&commat;Ubunut-Mohammed&colon;&sol;var&sol;www&sol;html&dollar; sudo chmod &plus;x wp-cli&period;phar<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image003&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNHNYH0Ef8MIfXcwk-5SgdIBP5pKnQ" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh6&period;googleusercontent&period;com&sol;b5GPridnBnciZpTfQAeHfLJtDxzN24ivYtyxn4RDPPmwjoK4M9kCPD3TeICP1VdBhLzz&lowbar;JeOff8kc0bWyNuIQ1nRr98zGj1N9gKrJVNdg9g7as0wmtk&equals;w572" alt&equals;"clip&lowbar;image003"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Next I will move the file<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2524 " id&equals;"quads-ad2524" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p>sudo mv wp-cli&period;phar &sol;usr&sol;&sol;local&sol;bin&sol;wp<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image004&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNFMEtqk&lowbar;qUzgmRW37vvenwTSaqOAQ" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh4&period;googleusercontent&period;com&sol;R3xRDS36HWV&lowbar;DHUVAKEJBCQXe-vKqPNofGZDNUG9f0cU7JervjGgmLKrC-XRXlPQdlH7yAM&equals;w673" alt&equals;"clip&lowbar;image004"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p> 3&period; Check if the file is working properly after moving&quest;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image005&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNFbrIFEF3VMX6RcOoVXjWmScfZg2w" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh6&period;googleusercontent&period;com&sol;fEtMb5BV8tWBjYT9N7smP&lowbar;WIefpuz&lowbar;KcsqJ1-FGHhCyXBIJLFq2fQopWv79xAbnSSHWpTdOD9aS7srVlxxisaTwK9fJgMo6iJNvqDU8nf&lowbar;6b7nQrBaQ&equals;w472" alt&equals;"clip&lowbar;image005"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p> 4&period; Final step is to change the domain of your wordpress site to a new domain&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>My previous domain was <a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;mytechweb&period;ga&percnt;2F&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNGTbmzu&lowbar;ZE6&lowbar;HoNCnvQ6mdqgxea6Q" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">www&period;mytechweb&period;ga<&sol;a> and now I changed it to <a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2F&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNH7KVtP4mv7OKybmFWpbPr-y1wxig" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">www&period;moh10ly&period;website<&sol;a><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>So I only used two commands to change the domain name to the new on<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p> 5&period; moh10ly&commat;Ubunut-Mohammed&colon;&sol;var&sol;www&sol;html&dollar; wp option update home &OpenCurlyDoubleQuote;<a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2F&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNH7KVtP4mv7OKybmFWpbPr-y1wxig" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">http&colon;&sol;&sol;www&period;moh10ly&period;website<&sol;a>&OpenCurlyDoubleQuote;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image006&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNFOlvbFA-7ezmIB5GCN3xa0S-ri1A" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;VX&lowbar;pqbfwMhHKk9R6zHWL6PjpvsLsfH0rbjrjnBLJmO&lowbar;LkKOS32464&lowbar;vQ-hphhEBRdQCu-60MNp2LK1Oz0&lowbar;NcD1osw-QjHaLOrpdAo5w3heooEt2Uy622&equals;w673" alt&equals;"clip&lowbar;image006"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p> 6&period; moh10ly&commat;Ubunut-Mohammed&colon;&sol;var&sol;www&sol;html&dollar; wp option update siteurl &OpenCurlyDoubleQuote;<a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2F&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNH7KVtP4mv7OKybmFWpbPr-y1wxig" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">http&colon;&sol;&sol;www&period;moh10ly&period;website<&sol;a>&OpenCurlyDoubleQuote;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fwww&period;moh10ly&period;website&percnt;2Fwp-content&percnt;2Fuploads&percnt;2F2016&percnt;2F01&percnt;2Fclip&lowbar;image007&period;png&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNHRzY1uUQtVM&lowbar;&lowbar;Z9FYSd1vjWd7Ykg" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;I0AH5ueocTdqTMl50FzHzBbGkRCxLoEjdCQEOWOvWgFIWs4ODdR4KFh9wWcg8F-137Woo9RejZp6VDp8W3mbrkUonsYCsd1S3J-Ig4GhU-7v&lowbar;up35UE&equals;w673" alt&equals;"clip&lowbar;image007"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Now I tested my website and it’s working perfectly…<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2529 " id&equals;"quads-ad2529" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p><a href&equals;"http&colon;&sol;&sol;wp-cli&period;org&sol;">http&colon;&sol;&sol;wp-cli&period;org&sol;<&sol;a><&sol;p>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2530 " id&equals;"quads-ad2530" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;

moh10ly

Recent Posts

Reset passwords for Active Directory Users

Reset and manage your Active Directory users' Passwords Active Directory is one of the most…

3 years ago

Finding Exchange Database hidden mailboxes. ​

Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…

3 years ago

Setting up ADConnect and PTA (Password auth through) servers agents behind proxy

If you're using a Proxy server in your firewall or in your network and have…

3 years ago

Get Report of Active Directory Locked Accounts and Machine they logged in from

Story:I got some clients  that have reported some of their users being locked out and…

3 years ago

Checking and Providing Full and SendAs delegate access on O365 Exchange Online

Delegate Permissions This is a code that I have wrote recently to check if an…

3 years ago

Retrieving attachments from Exchange mailbox using python

Story: I got a request from a client who constantly gets CVs and have to…

4 years ago

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298