How to Fix: WordPress Admin Dashboard Does Not Appear After Upgrade

Problem: You update/upgrade WordPress to a new version. All lokks great until you log into the admin area. You get a error page and the page redirect to a url that includes “/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F”.

Fix: After clearing cache and the usual errors, there is another possible culprit. The db_version in the database and in the config files do not match. To fix this, open the database in PhpMyAdmin, in the wp_options table, look at the db_version field. Now FTP to the site, and look at the wp_db_version variable in the file /wp-includes/version.php files. If they do not match, this is your likely problem. In most cases, the database needs to be edited to match the version in the file. Change the version number in the database, then open the WP admin in a new browser and try to login again. Hopefully this solves your problem.

SQL Code For Changing WordPress URL

Code to use for replacing urls in wordpress database:

UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
/*UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'widget_text' OR option_name = 'dashboard_widget_options';*/
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');

Remove Unnecessary Code From WordPress Header

WordPress uses the function wp_head() to add a bunch of code to the header of each page. Some of it is not absolutely necessary. This is especially true when using WordPress as a small business CMS, instead of a blog.

The code below removes the unnecessary code. Just add these to the end of your functions.php file.

This code applies to WordPress 3.0 and higher:

<?php
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'start_post_rel_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
?>

This code applies to WordPress versions before 3.0:

<?php
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'start_post_rel_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'adjacent_posts_rel_link');
?>