404 when Previewing an unsaved draft

Open the wp-config file and replace the line that reads define('WP_DEBUG', false); with:

if ( isset($_GET['debug']) && $_GET['debug'] == '1' ) {
define('WP_DEBUG', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '2' ) {
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '3' ) {
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
} 

After adding the above code to the wp-config file, saving it and replacing the original config file, you can add ?debug=1 to the end of the Admin URL of the specific page your on when getting the error. You can also enable a php-error file which can be useful in troubleshooting problems:

  • Create a file named php-errors.log
    Place this code before the OK Stop Editing line in the wp-config.php file:

    @ini_set(‘log_errors’,’On’);

    @ini_set(‘display_errors’,’Off’);

    @ini_set(‘error_log’,’/home/your-wordpress-files-folder/php-errors.log’); // path to log file

With any luck the errors will point you in the right direction to fix the problem.