This post title should have read “Help, my wordpress returns blank pages and I cannot log in to my admin page!”. I just thought it was fitting to say that WordPress f****d me over. It is as though Chris Hansen read a chat log of a computer predator called wordpress3xx and at this point he reads “I want to blank you” ;-). Well, WordPress really blanked me.
It is not so much that WordPress failed me, but rather a plugin I installed that really messed things up. The plugin is called WordPress HTTPS (SSL). My intention was to make my website secure. Well, it looks as though that won’t happen now.
I will begin by saying that the plugin is probably very well written and works for most users, but my experience was a mini nightmare. I’m just saying. If this happens to you, my solution would be to ultimately “reinstall” WordPress. In fact, I will guide you through the process, doing my job as the heavy lifter and the one who did the research, it says so on the title of the site, so I have to do it :).
What I mean by “reinstalling” WordPress is basically re-creating wp-config.php, exporting and importing a database. I guess you could replace all WordPress files if you want, to really reinstall it, but I didn’t have to. Below follows the three act game I played with WordPress as it blanked me this Sunday, so you don’t have to.
First, I was very hesitant to reinstall WordPress. In my mind I only had to change one configuration file and it would work again. The plugin couldn’t had done too much damage, so I thought.
The thing was, all pages were blank. I could not access the admin dashboard to do anything at all. One of the first things was to change my current theme folder according to http://www.hongkiat.com/blog/common-wordpress-errors-with-solutions/
Aaargh, that didn’t work… so I tried to change the name of my plugin folder. No luck there either. The funny thing was, I could still access my content and list my files. So the server was working, WordPress was not.
At one point I looked in the forums for the plugin and saw that they had a solution. See under “how do I reset the plugin’s settings”
I did what they recommended but nothing happened. The pages were still blank. Blank you WP HTTPS! I then looked in my /var/log/apache2/error.log and I got:
Fatal error: Call to undefined function wp() in /wp-blog-header.php on line 14
So, turning off super-cache and rewriting .htaccess from “scratch”. Unfortunately neither of those suggestions worked.
I took a break and watched an episode of Columbo, “It’s all in the game” with Faye Dunaway.
I must have seen every episode of Columbo several times, but I don’t remember seeing this one. It was a good episode. It gave Columbo some more depth, I believe. I began to feel like Columbo at that point, playing the cat and mouse game with WordPress configuration files.
Back to my investigation: I have had enough and my only conclusion was to reinstall WordPress.
First, I tried to find a way to copy my posts and settings. Where could they be? It turns out the files are somewhere in a database and the only way to move them is to log in to the database and export the files.
One suggestion was phpMyAdmin, but how can I run it, then? I’m using Ubuntu and auto-completion doesn’t bring up anything. Where should I put the files? It turns out I had to download it to /usr/share/phpmyadmin, http://www.phpmyadmin.net/home_page/
How do I run the thing? Well, phpMyAdmin is using php (ofcourse!), so it is simply run using a web browser, aha… Just type localhost/phpmyadmin and you will get a directory listing. Click on the phpMyAdmin and your browser will display the “log in” screen. Log in using the mySQL username and password.
Inside the database you have to click on the database which contains your posts.
Export and save it somewhere safe. I left the setting to SQL format.
Since I had to “reinstall wordpress”, I copied my entire wordpress folder, so I had all the content in case I mess up.
I followed the guide https://codex.wordpress.org using my mySQL client. I logged in with my root account (replace adminusername with root) and password I had set up before. I then created a new user database. I used localhost as hostname. Please note: You need the “” around the names when you grant privileges.
I moved wp-config.php to a safe place, because it contains important information about the old database user for your wordpress, if you ever need it again. I then accessed my website and it will ask me for the wp-config.php, because it needs it to access the database that is connected to the wordpress website. I simply moved it so wordpress will create it for me.
Access the webpage again and enter the information. This will create wp-config.php with your information. Hopefully wordpress will connect to the database. I changed the theme name and plugin folder back so WordPress would recognise them. At first I couldn’t install a theme. I don’t know why this happened.
Anyway, I moved on to import the database.
You need to log in to phpmyadmin and click on the database you wish to import to, select the file you exported.
Well, that didn’t help. I also restarted apache (necessary?), what was that again? service apache2 reload, yes.
So I realised that phpmyadmin also accepts compressed files, so I compressed it!
Since the database contains a lot of redundant information, because it is text, it was squished down to 400KB from 3MB. I imported it successfully but WordPress didn’t notice it! I forgot that I had actually changed the prefix from wp_ to wp_blahblah (look in your database). So I changed the $table_prefix = ‘wp_’; in wp-config.php to the one I use in the imported database.
Now I had to log in with my old name and password and everything works as it should. Some minor changes had to be done, such as theme settings and that all the swedish characters were butchered (Game of Thrones?). I only used those in my name, so no problem.
The solution of “reinstalling” WordPress by configuring a new database and importing it has solved the problem. I still think there has to be a simpler solution but it works so I’m happy.
There are many “Help, my wordpress returns blank pages!” or “Why is my WordPress Blog a blank page”, “My WordPress site is displaying a blank page”, “Wordpress blank page issue”,…
If you search “blank page wordpress” you get 11 100 000 results (April 7, 2014). The blank page is also called “white screen of death”.