WordPress Changed Hostname & Can't Access Admin - wordpress

I'm trying to recover a WordPress site where the hostname changed (unintentionally or maliciously). Because of that I can't even access the admin panel. Is there anywhere in the DB or code that the hostname can be updated? Here is what I'm seeing:
Many thanks. Kate.

I'm not sure it will work but you can try to get into the database and then find the wp_options table and there you can change the value of siteurl and home or in wp_site the domain and path.

Edit wp-config.php and add:
define('WP_HOME','http://www.corecomplete.ca');
define('WP_SITEURL','http://www.corecomplete.ca');

Some of the links are fine, as those are likely stored in the database as content.
Let's do some checks first to see if something changed that you can quickly edit yourself:
Step 1
Open the wp-config.php file. Do you see the constants 'WP_SITEURL' and 'WP_HOME' being defined? It would look like this:
define('WP_HOME','http://something.com');
define('WP_SITEURL','http://something.com');
If they are in there, make sure the URL is set to your website's domain address, as #Eravald indicated above.
If they are not in there, go ahead and add them per #Eravald's instructions:
define('WP_HOME','http://www.corecomplete.ca/');
define('WP_SITEURL','http://www.corecomplete.ca/');
Step 2
Let's check the settings in the database. Open up phpMyAdmin and then the options table, which would be wp_options if you used the wp_ as the database prefix.
The first two records are the siteurl and home. Make sure those are set to http://www.corecomplete.ca/.
If no, do this:
Backup your database
Double click on the option_value column for the entry you want to
change. Then change it to the right domain URL. Be Careful! You
are changing your database.
Did it fix the problem? If no, go to the next step.
Step 3
Contact your hosting provider. Let them do some checks. It looks like a staging server IP address being applied to it.

Related

wordpress move to localhost missing css

I'm trying to move a wordpress/buddypress web site to my local pc.
I created a virtual host with the exact same host name, copy the code and DB.
It works but every time I change the C:\Windows\System32\drivers\etc\hosts file to see the live original site, chrome miss-behave and get stuck.
So I tried to change the site domain on my local pc - I search&replace the code & db export from the site domain to my local domain (e.g. mydomain.com -> mydomainlocal.com), and I reinstall the DB.
The site is running but it seems to be missing some stuff - specifically design stuff, e.g. css is different, and logo display the site name instead of the logo.
It seems like the new domain name triggers a different configuration of the site, or a different theme.
Can someone please explain how to properly move a wordpress site localy with a local domain name?
I read some posts about this issue and it seems I was doing it right, I actually don't understand why the site looks different if I changed all reference both in the code and DB.
I'd suggest the problem lies with the fact you've performed a search and replace on the database.
WordPress serializes some data and by running a search and replace on it you'll have changed the lengths therefore breaking the serialization. Often things like theme options are stored in that way and will appear to reset when broken.
In order to update the URL you'll need a more advanced tool like: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Further information: https://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs
First You must change domain name in database wp-options table
where option_name is suteurl and home
If not help, see in wordpress admin panel theme settings, some
themes have setting and in setting those can have url setting
In browser , in source you can find errors, and in errors you can see
not correct urls
I was able to solve it answer thanks to Nathan Dawson answer, here are the actual steps I did.
I switch back to the original DB (in wp-config.php),
setup the local host of the original domain mydomain.com (NOTE that I didn't delete the settings of the new local host - mydomainlocal.com)
In mydomain.com/wp-admin/options-general.php I changed the WordPress Address (URL) and Site Address (URL) to the new domain mydomainlocal.com
click save
After saving this settings the site redirects to the new domain immediately, but since I kept the setting of the new domain it worked, and the problem is solved.
EDIT - a quick and simple solution is simply change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar)

Error Moving WordPress

I'm in the process of trying to move a WordPress site from "example.com/wordpress" to "newsite.com" and I've run into some considerable trouble.
I made a backup of the database and put a copy of all of the WP files onto the new host. I then tried to change the URL, but got a bunch of errors on the new page. I tried to revert back to the old site in the hopes getting everything in order again, but now everything redirects to the "new" site. My wp-config and database settings are all the same as they once were since I never deleted them off the old site. I've since deleted the files from the new site. The page is still redirecting and I can't access the dashboard login.
I'm completely at a loss right now, so I could really use some expert opinion. Thanks for any help that leads to a solution.
Old Site Link
If you have access to phpmyadmin or any interface for your database you can go into the wp_options table and update rows 1 and 36. As jogesh_pi mentioned, the base url of your site is stored there, so you will need to update the database with your new path.
You can run this query in phpmyadmin and it will do it for you. Obviously replace the newsite url with your own.
UPDATE wp_options SET option_value = 'http://www.newsite.com' WHERE option_name = 'siteurl' OR option_name = 'home'
You need to run a database query that updates all instances of your old URL with your new URL. The process is explained in detail in the Wordpress Codex.
I like to use this very useful PHP script for running the database update automatically as it takes into account serialized strings which in certain cases can break widgets or plugins if they are not addressed.
I always run into this issue, I use this plugin now to transfer wordpress sites: http://wordpress.org/plugins/duplicator/
But heres a quick fix:
Login to phpmyadmin, go to your database
Go to wp_options
Change these two options to your new url where my url's are the old ones:
If your wp-content folder is of the old site contents, it should pick up. But if your images dont show, use a URL changer plugin like this one: http://wordpress.org/plugins/velvet-blues-update-urls/
it's just a simple query that helps you to transfer your wordpress site from old to new.
update wp_options set
`option_value` = replace(`option_value`, 'example.com/wordpress', 'newsite.com');
beside this make sure about the file permissions and the database is same that you have used in the old site.

i need to put back/ (change) WordPress Address (URL) - should be simple

I made a mistake and changed the SETTINGS / WordPress Address (URL) in WordPress and now i cant get into the back-end anymore.
The problem is that, i have a site on a "dev" folder so the address was "mySite.com/dev", and this is where WordPress was(is). I mistakenly removed the "dev" and now its the normal "mySite.com".
I need to put everything back but since i removed the "/dev", WordPress always redirects me to the main site and i dont have access to the back end anymore.
How can i restore it so i can access my WordPress dev site on the dev folder?
Thanks in advanced.
The simplest way to do this (especially if you aren't comfortable in phpMyAdmin) is to FTP in and edit your wp-config.php file in the base WP directory (e.g. mysite.com/dev) and add these lines:
define('WP_HOME','http://mysite.com/dev');
define('WP_SITEURL','http://mysite.com/dev');
Next time you visit the site it will automatically change the settings. Note that this will cause the associated fields in the admin panel to be grayed out, so when you want to change the URL in the future you will need to either update or delete these lines from the wp-config file.
There are several different methods for resetting the site URL in WordPress. Some involve editing wp_options and others wp-config.php, with varying degrees of difficulty. See Changing The Site URL « WordPress Codex for recovery instructions.
You can change this settings via phpMyAdmin
in table wp_options change the option value for siteurl and home.
To restore the correct address, I got the best results by going into MYSQL directly and updating the entry.
I found that hard coding the site address by adding lines to wp_config.php gave incomplete results. The admin pages still looked buggy. And I couldn't change the address from the Wordpress admin site anymore. I'm sure phpMyAdmin works fine, but I didn't want to install anything extra.
Log in $ mysql -u [your-mysql-user] -p
Make a note of what your tables are named. I believe the "wp" prefix is standard for all table names, but this may vary by installation.
> show databases;
> use [your-wordpress-database];
> show tables;
> desc wp_options;
Look up current value.
> SELECT option_id, option_name, option_value
> FROM wp_options
> WHERE option_name="siteurl";
Output should look something like: 1 | siteurl | [current path with incorrect value]
Replace with correct value
> UPDATE wp_options
> SET option_value="[new path]"
> WHERE option_name="siteurl";

changed wordpress address to a site i dont own by accedent, recovering it

I was going through the 'settings' tab of my wordpress site and by accident i changed my WordPress Address (URL) and Site Address (URL) to a site i dont own (i accidentally put .com instead of .co.uk)
Now when i go to mysite.co.uk/wp-admin it takes me to the other site (the .com) i dont own, as you can see this is a big problem, is there a easy way i can get back into wp and change this back over ?
is there somthing i one of the wp-config.php files i could download edit and upload again, or a part of a db table i need to update ?
When I developing a site it I do it on a test server and then push to the live server. To do this I change the two fields in the mySQL database. In phpmyadmin you can change the wordpress options.
wp_options table
edit the siteurl option.
and any other instances that you want to make sure are correct.
The following query should find them.
SELECT * FROM wp_options WHERE option_value LIKE '%mysite.com%'
Then edit those files, be sure to make a backup of your database before you do that. It should work but at times changing the database like that might affect things in your menu or else where on your site. It should fix your oops and allow you in to make things right.
Add these lines to the top of wp-config.php:
define('WP_HOME','http://mysite.co.uk');
define('WP_SITEURL','http://mysite.co.uk');
In functions.php, use these two lines:
update_option('siteurl','http://mysite.co.uk');
update_option('home','http://mysite.co.uk');
Load up http://mysite.co.uk/wp-admin, verify that you can get in, and then remove those lines from the files.
go to your phpmyadmin and select the table called wp_otions
change site url to your previous site http://mysite.co.uk.
it worked for me .
Run this query in your MySQL database, with the URL changed to your actual site URL:
update wp_options
set option_value = 'http://example.com'
where option_name in ('siteurl', 'home');
NB: assumes that your WordPress tables are prefixed with 'wp_', adjust as necessary if not.

Moving Wordpress site to new server/domain | getting asked to reinstall WP

I'm getting asked to reinstall Wordpress (standard 5 minute install) after moving a site to a new server and domain name.
http://kevineikenberry.com
Testing URL:
http://keg.brettatkin.com
I've checked the wp_config and the new db settings are correct and working - I set up a test page that pulls records from the db.
I've done must of the things listed in this thread (http://stackoverflow.com/questions/4367058/problems-with-moving-my-wordpress-site-to-another-domain-server) such as running a couple of queries to update the domain name.
One additional thing I did do was change the table extension to something other than wp_
Any help would be awesome. I'm at a loss and must be missing something stupid.
Thanks
Brett
you chanced the prefix of your tables, if you do this there are DB record which need to be changed, also you have to change it in config.php
take a look at this:
http://digwp.com/2010/10/change-database-prefix/
You have changed the table prefix, that means you have different tables and your wp-config settings will not work, if you have changed your tables prefix also update it in wp-config file, save and check it again.

Resources