Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hi I developed a website in wordpress on my localhost then moved it to a live server. Everything is working fine except wp-admin. When I go to domain/wp-admin it shows a white screen. Yet when I go to domain/wp-login.php it allows me to login to the admin. Also if I try to create new post or update any settings it keeps showing a blank white screen, yet when refreshed has saved the settings/added the post etc. The site is www.nuvogadgets.com.

Any ideas? Thanks!

share|improve this question
    
Hi ... this is a very common question / problem on here and there is a dedicated page on the Codex on how to move WordPress codex.wordpress.org/Moving_WordPress –  Damien Oct 15 '12 at 11:16
    
It sounds like you might have a problem with your functions.php file. I would suggest removing the last ?> in the file. –  Lea Cohen Oct 15 '12 at 12:17
    
@PaulElliot: White screen = no debugging info.Add that to your wp-config.php file (details about WP debugging in Codex). –  kaiser Oct 15 '12 at 14:54
add comment

2 Answers

up vote 3 down vote accepted

When you say moved WordPress, what do you mean exactly,

  • Did you copy your entire WordPress installation from your localhost to your remote server without installing WordPress first on your destination host?

  • Did you export your SQL database from localhost then import it to your remote server?

  • Did you install WordPress on your remote server before copying your theme folder across?

It's likely that the parameters found under Settings -> General for both,

  • WordPress Address (URL)
  • Site Address (URL)

Are both incorrect and still pointing to your localhost environment.

You should install WordPress from scratch on your remote server prior to copying over your theme instead of copying your entire WordPress folder from your localhost.

Otherwise if you want, login to your MySQL manager (likely phpMyAdmin) and edit the entries for,

  • WordPress Address (URL)
  • Site Address (URL)

Under the wp_options table.

As suggested by Damien (in comments), there is of course a whole section on the Codex dedicated to this topic,

http://codex.wordpress.org/Moving_WordPress

In particular the following section title "If you forget to change the locations", relates directly to the WordPress Address URL and Site Address URL mentioned above.

share|improve this answer
2  
Hi there ... you might like to include a link to the Codex page codex.wordpress.org/Moving_WordPress ... also I think the OP can't get to /wp-admin so they would have to login in via PHPMyAdmin. –  Damien Oct 15 '12 at 11:14
    
Yes, I like. I should clarify that I recommending to login via phpMyAdmin, not via wp-admin, that's just a reference of where those parameters of normally held - just to give some context. Though, the section I link to within the Moving WordPress Codex page shows an alternative using update_options to reset the URLs. Thanks for reminding me about the link, a must read for anyone moving WP for the first time. –  userabuser Oct 15 '12 at 12:21
add comment

Whenever I copy over my WordPress to a new location I always take over my database modifier php script:

<?php

$database_host = '';
$database_user = '';
$database_pass = '';
$database_name = '';

$replacement_values = array( 'http://oldurl' => 'http://newurl' );
$text_fields = array( 'char', 'text', 'varchar' );

$mysql = mysql_connect( $database_host, $database_user, $database_pass );
if ( !$mysql ) {
    die( 'Could not connect: ' . mysql_error() );
}

$mysql_database = mysql_select_db( $database_name, $mysql );
if ( !$mysql_database ) {
    die( 'Can\'t select database: ' . mysql_error() );
}

$tables_result = mysql_query( 'SHOW TABLES' );
while ( $tables_row = mysql_fetch_row( $tables_result ) ) {
    foreach ( $tables_row as $table ) {
        $columns_result = mysql_query( 'SHOW COLUMNS FROM ' . $table );
        while ( $columns_row = mysql_fetch_assoc( $columns_result ) ) {
            $column = $columns_row[ 'Field' ];
            $type = $columns_row[ 'Type' ];
            foreach ( $text_fields as $text_field_type ) {
                if ( strpos( $type, $text_field_type ) !== false ) {
                    echo '<p>' . $type . ' - ' . $column . ':' . $table . '</p>';
                    foreach ( $replacement_values as $replace => $replacement ) {
                        $replace_query = sprintf( 'UPDATE %s SET %s = REPLACE(%s, \'%s\', \'%s\')', $table, $column, $column, $replace, $replacement );
                        mysql_query( $replace_query );
                    }
                    break;
                }
            }
        }
    }
}

mysql_free_result( $columns_result );
mysql_free_result( $tables_result );
mysql_close ( $mysql );

?>

You can change the values here:

$replacement_values = array( 'http://oldurl' => 'http://newurl' );

to what you want to replace.

share|improve this answer
    
What about the serialized strings? Next time use this: interconnectit.com/124/… ;) –  Miha Rekar Oct 20 '12 at 8:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.