Hasteify
Hasteify

Reputation: 63

Issue with Wordpress After Moving Files

So I moved my installation of WP to a different folder in my web directory (to the root from a sub directory /wp) and now I have a fatal error, and cannot seem to fix it. Here are the errors:

Warning: array_keys() expects parameter 1 to be array, string given in D:\Hosting\2974365\html\wp-includes\class-wp-roles.php on line 126


Warning: Invalid argument supplied for foreach() in D:\Hosting\2974365\html\wp-includes\class-wp-roles.php on line 126

Fatal error: Cannot unset string offsets in D:\Hosting\2974365\html\wp-includes\widgets.php on line 1141

Any help would be greatly appreciated... can't figure it out for the life of me.

Upvotes: 3

Views: 321

Answers (2)

I.T.
I.T.

Reputation: 61

Anytime you move Wordpress, you need to change the siteurl and the home to the new path. Apart from that, if you have posts, you also need to update their URL. Here is some SQL to help you do it, make sure you change the OLD_URL and NEW_URL fields.

Login phpMyAdmin, select the database and after you change the fields, execute the following queries:

UPDATE wp_options SET option_value = replace(option_value, 'OLD_URL', 'NEW_URL') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'OLD_URL','NEW_URL');

UPDATE wp_posts SET post_content = replace(post_content, 'OLD_URL', 'NEW_URL');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'OLD_URL', 'NEW_URL');

Upvotes: 1

fil
fil

Reputation: 137

Try updating the 'siteurl' option in the wp_options table.

Upvotes: 0

Related Questions