Wordpress - Changing Wordpress in Place to a New Domain - wordpress

I have Wordpress install at
scottmollon.com/williammessner-loebs
The files are in public_html/williammessnerloebs
But we wanted to get him his own domain.
So I got bloebs.com, and set it up as an Add-On Domain with my host provider (A2 Hosting).
I configured bloebs.com to point to /public_html/williammessnerloebs
So if you go bloebs.com you correctly see the wordpress site.
But if you click on a post it takes you to scottmollon.com/williammessnerloebs/2019/10/10/appearances/
for example.
I'd like to have all the urls be bloebs.com urls.
I tried changing the site url and home url in my Wordpress general settings, but that just breaks everything. Pages load with no formatted or styled content or images. I've fixed it by editing those urls back to scottmollon.com urls in my database.
Is there anyway I can accomplish what I hope to do?

The first step you took was the right. But there is some more to do:
Change your site url and home url. You can do this in the backend in general settings, or you can edit your wp-config.php file and add (maybe you have https):
define( 'WP_HOME', 'https://bloebs.com' );
define( 'WP_SITEURL', 'http://bloebs.com' );
Log into your backend (you will be logged out at first) and go to your general settings to check if the new url is set. Also go to "permalinks", make your choice and hit save.
Install a Plugin to overwrite the urls in your database, like https://wordpress.org/plugins/go-live-update-urls/ In this plugin you just need to enter your old wordpress url and then your new url. You do not need to overwrite plugin files, so keep that unchecked.
After that, everything sould be working fine. You can delete the plugin again, because you don't need it anymore.
If you have any urls in your theme files, that you are not getting dynamically but have inserted them by hand, you have to edit this by hand. The Plugin "Go live..." will only overwrite the urls in your database.
Hope this helps you out.

Related

Wordpress and temporary access url

I hope everybody is well.
I have to set up a new Wordpress site, but this is the first time I need to setup the website "before" the domain name is registered.
I have webspace on shared webhosting and I can setup the Wordpress site using a temporary subdomain for my shared hosting, but this will mean setting up the Wordpress site using the temporary access url instead of the proper domain name that will be done next week.
If I setup the Wordpress site using the temporary url, once the domain name is registered, is simply changing the website address in the Wordpress General settings adequate or will I need to update the database too?
Is there a plugin that will do the above?
Thanks in advance if anyone can assist.
AH
You can proceed and start setting up your WordPress site to start designing, ones you've completed and domain name is registered like you've said, you can:
Backup your File Manager files to a local storage Highlight the content, right click, and click compress then download.
Navigate to the root folder of the now newly registered domain(public_html), and upload the files you downloaded above.
Go to the wp-config.php file, highlight and select edit.
Just before a line with this words /* That’s all, stop editing! Happy blogging. */
Add the lines below then save and close.
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
example.com is the new domain.
Now go back to your WordPress site to update the links. Yes, their is a plugin to update links, a lot of them but search for 'Velvet Blues Update URLs' using the plugins-> Add new.
After installing and activating the plugin,go to Tools -> Update urls, enter your old (subdomain) and new (root domain) URLs and in Step 2, check all options except Update All GUIDs.
Click the Update URLs Now button to proceed.
Check out under FaQs of your hosting provider if they've indicated a method on how users can move sites from subdomain to main domain.

domain redirecting to localhost/wordpress

this is my first time, I am installing a wodrpress localhost(xampp) to main server.
According to tutorial I Imported database from local machine to main server. Changed the the table prefix and http://localhost/wordpress to https://example.com.
after installing theme domain shows empty theme.
I changed all the http://localhost/wordpress used on theme. But didn't work.
Then according to another tutorial I imported full localhost wordpress file.
Then It redirecting my domain to http://localhost/wp-wordpress. Then I decided to fully reinstall the wordpress and as per I removed file from public html which I uploaded.
Now my domain redirecting to http://localhost/wp-wordpress after removing files I uploaded.Public html folder
my site
After reinstalling wordpress on server admin dashboard working fine but domain redirecting to localhost/wp-wordpress
You can change the url many ways in wordpress. You can use to change the url as you understand and follow the steps as I mentioned in below,
Change WordPress URL in Admin Dashboard
Change WordPress URL in wp-config.php File
Change WordPress URL Directly in Database
Change WordPress URL With WP-CLI
Get More understanding the details, Follow the article - How to Change Your WordPress URL
Thanks!
After checking wp-config.php and site_url,home_url in wp_options table in database. Take a view on .htaccess file too. This file should look like this htaccess code
Please change the site_url from the wp_option table. There are 2 rows containing the website base url in the wp_option table. You need to change both url to the main domain url.
Thank you

How to update get_stylesheet_directory_uri in wordpresss

How do I update get_stylesheet_directory_uri? Transferring a website and I have already updated the url for the site inside wp-config using:
define('WP_HOME','https://somewebsite.com');
define('WP_SITEURL','https://somewebsite.com');
Still when get_stylesheet_directory_uri is called it is using a previous url, any idea on how to force this to update?
Thanks!
Once you change the site URL using those DEFINE statements, you also need to flush the permalink settings. Just go to wp-admin -> Settings -> Permalinks, and save without making any changes. That should force it to use your new values.
If you have access to the site via FTP, then this method will help you quickly get a site back up and running, if you changed those values incorrectly.
FTP to the site, and get a copy of the active theme's functions.php file. You're going to edit it in a simple text editor and upload it back to the site.
Add these two lines to the file.
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Use your own URL instead of example.com, obviously.
Upload the file back to your site, in the same location. FileZilla offers a handy "edit file" function to do all of the above rapidly; if you can use that, do so.
Load the login or admin page a couple of times. The site should come back up.
Another thing that can happen if your site is multilingual is that get_stylesheet_directory_uri is used in a registered string whose translation is still using the previous domain. In that case, search and replace your translations with the new domain.

Some posts pointing to old url after changing domain

I changed my domain name for my website and I double checked with the migration document on Wordpress, everything is as it should be.
Problem:
When permalinks is set to default:
all pages work, expect for a button on homepage which sends me back to the homepage but updates URL.
For Example: Im on example.com and i press search button>> URL changes to example.com/search but im on the same homepage. I press it again, URL becomes example.com/search/search. Interesting and Frustrating.
When permalinks are set to other settings like day, month:
Some pages redirect to old domain. Example: if i click on search on my website , it will take me to oldexample.com/search. when i manually update URL to example.com/search, I can see the page. BTW, oldexample/search gives me nothing.
**New Problem:**Recently, I activated all in one seo and sitemaps dont work with default permalinks.
Example: example.com/sitemap.xml gives me my homepage instead of the sitemap page. When i change the permalinks to other settings, I can see my sitemap.
I mean, what is this??
PS: Its a multisite installation with ONLY 1 SITE. and I had W3 cache, deleted it. problem exists.
PSS: when i submit my sitemap.xml to google with default permalinks, it says its HTML. so i changed permalink to date month and submitted; Successfully.
Using the "search and replace" script, I updated my links. Uploaded the script to the folder containing wp-admin, wp-include and the likes. Followed the instructions and clicked on dry run.
I found that my wp-postmeta contained some old urls. Updated just that 1 table and that did the trick.
Use a Search and Replace DB script if you are transferring a wordpress site (along with the database) to another domain.
The DB contains links from old domain, so you need to replace the old ones with the new ones. Just be careful and make a DB backup just in case.
This script is a great tool if you are creating a WPMU sites. Just copy the site and to a subdirectory (/en, /de, whatever your name domain is), import the old DB to the new one, and run this script before you've entered the site.
It is crucial not to enter the new site before running the script so that all the old links will be picked up correctly by it. After you've replaced it, you're good to go.

Migrating wordpress

I am trying to migrate a Wordpress website from one hosting to another one. In the new hosting I can see it correctly if I access it from localhost, but if I try to render the web from an exteral pc, the .css and the images are not loaded (you can see it here 91.121.122.50/wp
Note that the link to the images points correctly (if you copy-paste the url of any image and open in a new window, it will load)
The new host has been configurated for a user, so I think it is a etc/hosts, apache2 or php configuration issue.
You can either update the database
//FIXME: do comment/remove these hack lines. (once the database is updated)
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );
http://codex.wordpress.org/Moving_WordPress
or place the folowing in you wp-config
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
http://codex.wordpress.org/Changing_The_Site_URL
In order to make all links working you've to update your htaccess in your admin area under settings -> permalinks.
There is a WordPress plugin called duplicator. Using this plugin we can transfer WordPress website from one host to another. I think this is the simple and easy way to transfer WordPress sit. Here is the link.

Resources