Den vita skärmen av död kan vara en webbplatsägares värsta mardröm. Detta frustrerande WordPress-fel gör att du stirrar på en tom sida utan att få några ledtrådar om vad som gick fel.
Till råga på allt kan detta vanliga WordPress-fel ibland påverka specifika delar av din webbplats, t.ex. adminområdet eller enskilda inlägg.
Vi har till exempel sett den vita dödsskärmen inne i WordPress adminområde medan allt annat fungerade bra. I andra fall såg vi det bara när vi tittade på ett specifikt inlägg.
Att förstå de grundläggande orsakerna till detta fel är det första steget mot att hitta en lösning. Den här guiden kommer att ta upp några lösningar för att åtgärda den vita skärmen av död och ge handlingsbara steg för att återställa webbplatsens funktionalitet.
Note: Innan du gör några ändringar på din site ska du se till att du har en backup av din WordPress-webbplats. Om du inte har tillgång till admin area, se vår guide om hur du manuellt skapar en backup av WordPress database.
Varför ser du den vita vyn av döden i WordPress?
När du ser en vit vy när du försöker besöka din website i WordPress betyder det för det mesta att ett skript på din website har förbrukat minnesgränsen.
Skriptet som inte svarar dödas antingen av din WordPress server på webbhotellet eller så tar det helt enkelt slut. Därför genereras inget egentligt message error, utan du ser bara en tom vit vy.
Ibland kan du dock se ett error message.
Du kan till exempel se ett critical error message i stället för en tom page.
Om du ser en tom vy eller meddelandet ”There has been a critical error on your website”, så är det samma fel.
Detta error kan också uppstå på grund av ett dåligt kodat theme eller plugin installerat på din site. Ibland kan det hända om det finns en issue med din web server.
Eftersom error på vit vy kan orsakas av många olika saker, är det obligatoriskt med metodisk felsökning för att fixa det. Här är de steg du bör försöka:
- Check Whether the Problem Happens on Your Other Sites
- Fix the White Screen Error With WordPress Recovery Mode
- Increase the Memory Limit
- Fix the White Screen Error by Disabling All Plugins
- Activate the Default Theme
- Enable Debug Mode to Catch Errors in WordPress
- Clear the WordPress Cache
- Fix the White Screen Error for Longer Articles
Video Tutorial
Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.
1. Kontrollera om problemet uppstår på dina andra webbplatser
Om du har andra WordPress-webbplatser installerade på samma webbhotell konto, då vill du börja med att kontrollera om problemet händer på andra webbplatser också.
Om det är så, är det en stark indikator på att något är fel med ditt webbhotell för WordPress. Detta kan vara en tillfällig issue som påverkar deras tjänst, och du måste kontakta deras support för mer hjälp.
Å andra sidan, om the issue bara inträffar med en website eller en viss del av den webbplatsen, då vet you att problemet är med just den webbplatsen.
2. Fixa error med vit vy med WordPress återställningsläge
Om erroret ”White Screen of Death” orsakas av ett plugin eller theme för WordPress, kan WordPress kanske fånga upp det.
Den nya funktionen för skydd mot fatal errors som introducerades i WordPress 5.2 kan ibland fånga upp error, så att du kanske inte ens ser en vit vy. Istället kommer du att se ett message om att webbplatsen har tekniska problem.
WordPress kommer också att skicka ett email om problemet till din admin email address.
Emailet kommer att ha rubriken ”Your Site is Experiencing a Technical Issue”.
Detta email message kommer att peka ut det plugin eller theme som orsakar error, och det kommer också att innehålla en speciell länk.
Denna link allow you to logging in to the WordPress recovery mode and deactivate the faulty plugin.
Men om du ser den vanliga vita dödsskärmen utan alternativ för email eller återställningsläge, måste du fixa felet manuellt.
3. Öka limit för minne
Vanligtvis beror detta error på att ett skript har förbrukat din web servers minne och avslutats mitt i.
För att fixa detta måste du öka PHP-minnet som är tillgängligt för WordPress. Detta kommer att allow skriptet att använda mer minne för att slutför det jobb som det var tänkt att göra.
Du måste editera wp-config.php-filen på din WordPress site eller använda ett code snippet plugin som WPCode.
Du kan följa instruktionerna i vår tutorial om hur du ökar PHP-minnet i WordPress.
4. Fixa felet med vit skärm genom att inaktivera alla tillägg
Om det inte hjälpte att öka minnesgränsen för PHP, eller om du har en hög minnesgräns, gillar 256M eller 512M, måste du börja med troubleshoot.
I vår erfarenhet av felsökning av detta problem har vi alltid funnit att issue är antingen med ett specifikt plugin eller ett theme. Låt oss gå vidare och inaktivera alla tillägg.
Om du fortfarande kan komma åt WordPress admin dashboard, kan du helt enkelt gå till Plugins ” Installed Plug ins page. Välj alla installerade tillägg och välj sedan ”Deactivate” i dropdown-menyn ”Bulk actions”.
Men om du inte har tillgång till admin area i WordPress måste du deactivate alla tillägg via FTP.
Anslut först till din WordPress site med hjälp av en FTP-klient eller din hosting providers filhanterare. När du är ansluten går du till mappen wp-content
, där du ser mappen tillägg
.
Nu måste du högerklicka på mappen plugins
och sedan välja ”Rename”. You can rename the plugins folder to ’plugins-deactivated’.
WordPress letar efter en folder med namnet plugins
för att hämta alla tillägg. Om den inte hittar denna folder deaktiveras helt enkelt alla tillägg.
Om detta fixar problemet aktiverar du ett plugin i taget för att komma till botten med problemet. När du har hittat det plugin som orsakar problemet kan du ersätta det med ett alternativ eller rapportera problemet till plugin-författarna.
5. Activate standardtema
Om felsökningen av plugin inte fixar problemet, bör du försöka ersätta ditt aktiva tema med ett standardtema.
Anslut först till din website med en FTP-klient och gå till mappen /wp-content/themes/
. Den innehåller alla teman som installerats på din website.
Högerklicka för att selecta ditt nuvarande WordPress theme och downloada det till din dator som backup.
Därefter måste du ta bort ditt nuvarande theme från din website.
Högerklicka bara på din theme folder och välj ”Delete”. Din FTP-klient kommer nu att delete temat från din website.
Nu, om du har ett standardtema för WordPress som gillar (Twenty Twenty-Two eller Twenty Twenty-Three) installerat på din website, kommer WordPress automatiskt att börja använda det som standardtema.
Men om du inte har ett standardtema installerat måste du installera det manuellt med FTP.
Om detta fixar problemet, bör du titta på ditt temas functions.php-fil
. Om det finns extra mellanslag längst ner i filen måste du remove dessa, och ibland fixar det the issue.
Om du använder en dåligt kodad funktion i ditt temas functions.php-fil
kan det också orsaka error med white screen of death.
Överväg att downloada en ny kopia av your theme från källan och sedan installera det manuellt med FTP.
6. Aktivera debug-läget för att fånga upp error i WordPress
Om inget har hjälpt hittills är nästa steg att slå på debug i WordPress. Då sparas error logs som allow you att se vilken typ av error som skrivs ut.
Add helt enkelt följande kod till din wp-config.php-fil
:
define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
När du har addat detta kommer den tomma vyn nu att innehålla error, varningar och notices. Dessa kan kanske hjälpa dig att hitta grundorsaken.
Om du inte ser några fel kanske du ändå vill kontrollera debug-loggen.
Besök bara wp-content
foldern på din website med hjälp av en FTP-klient. Där hittar du en new debug.log-fil
som innehåller en logg över alla fel, notices och varningar.
7. Clear cachen i WordPress
Ibland kan du ha tillgång till back-end, men front-end av webbplatsen har den vita dödens vita vy.
Detta kan hända på grund av ett plugin för caching. I så fall behöver du helt enkelt tömma din WordPress-cache.
Du kan se vår guide om hur du clearar cachen i WordPress för detaljerade instruktioner.
8. Fix the White Screen Error för längre artiklar
Om du bara har en vit skärm av död på en mycket lång post eller page, kan den här metoden fungera.
Detta trick ökar i princip PHP:s textbehandlings-capability genom att öka recursion och backtrack limit. Du kan klistra in följande kod i din wp-config.php-fil
:
/** Trick for long posts */
ini_set('pcre.recursion_limit',20000000);
ini_set('pcre.backtrack_limit',10000000);
Vi förstår att detta är ett mycket frustrerande error, och vi hoppas att ett av knepen ovan har löst problemet för dig.
Du kanske också vill se vår WordPress-felsökningsguide, som lär ut de steg du bör ta för att hitta och åtgärda WordPress-problem själv, eller vår lista över de vanligaste WordPress-blockredigeringsproblemen och hur du åtgärdar dem.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Omar Sirwan
I solved it…
I tried those:
define(’WP_MEMORY_LIMIT’, ’64M’);
Change Plugins name
Check white spaces
Increase memory
Change Theme
Upload new wp-admin
And everything related to plugins
Finally I downloaded my wp-config using FTP. Opened it with notepad++ and save it again with the encoding utf-8… It was utf-8 BOM.
Linda
My page does not work! it shows SERVER ERROR 500. and i am unable to log into the admin
Andreas
Thank you, changing the SiteURL did the job.
What a weird bug…
Girish
I am telling you i cannot access my wp-admin page how i am suppose to disable plugin and change the theme.
WPBeginner Support
Simply connect to your website using an FTP client and rename the plugins folder to plugins-old. This will deactivate your plugins directory.
Administratör
Madeleine Landley
This is one of the most extensive guides I found so far – with easy tutorials on how to solve it. I like it!
I’m actually only missing one thing causing WSOD and that is extra spaces in the code, usually in functions.php, header.php, single.php etc. I’ve found this error causing most of the white screens I’ve resolved. The extra spaces are usually at the end of the file, after a closing ?>, used instead of tabs and on line breaks (empty rows).
Thanks for a great guide.
Michael Silva
After some changes (failures !!) in the code of a plugin did the famous White wp screen with the following message ”Parse error: syntax error, unexpected ’the’ (T_STRING) in / home / velafati / public_html / wp-content /plugins/woocommerce/includes/class-wc-countries.php on line 436 ”
How to know where the problem had been entered in the file ”class-wc-countries.php” through cpanel and replace all the code for the original code (had recorded the original code in Notepad). The problem is that even after upgrading to the problem folder remains, what should I do?
viki sangre
I have the same issue. I have made no changes to my website but when I saw my website in the morning it show white blank screen. I haven’t updated any plugin.
Backend is working well.
Any help please!!
viki sangre
I updated my wordpress with latest version and every things gonna fine. I think automatically updation of wordpress also cause a problem.
Hansel
Hi Guys,
I got some white space page issue in our wordpress page and did below troubleshooting but still no luck. It’s also weird that I don’t get any error.log that’s why it’s kinda hard to know the exact issue. Any help would be very much appreciated. Thanks Guys.
Troubleshooting made:
Disabled all plugins
tried to use the default theme
restarted apache2
Sabina
I fixed it! It was a plug in. Do NOT update the Yuzo plug in if you currently have it!
Sabina
Please help!!! I think I’m gonna die! I get the white screen and I cannot get to my admin page. Everything is white :(:(:( Please, please tell me step by step what I should do not to mess things even more!
Thank you!
Naomi
I experienced the white screen of death tonight and I couldn’t access my login, website, or any of the pages. I fixed it by going to hosting site and pulling up the file manager. I was able to edit the code I had misplaced through the files on the hosting site and then my site came back up!
Lee Binder
In our case it was problems with cron, either WP cron or the server’s cron service. ”Fixed”/ worked-around with the WP Delay Cron Plugin
Thomas
Hi all, I have the same error but cant even access the login page for my site! Any ideas on what i could do? Thanks!
calvin
I had the same issue, it was a plugin. went to the cpanel, then file manager, public html folder and on right side, right click on ”error log” to view error. Plugin causing error was renamed and whala… I could get to the dashboard.
Hope this helps you and others!
Bomi
This should be the firt option if you only have access to FTP, it will tell you exactly which file is messed up. Thanks.
error_reporting(E_ALL); ini_set(’display_errors’, 1);
define( ’WP_DEBUG’, true);
Kay
I get an error message that says Site can nor be accessed. Disconnect site. When I click on admin the screen goes white. Please help!
Andy
I had this problem with my installation (white screen only on WP-admin. I eventually solved it by using the debug tools in the browser (hit F12 in most browsers). Using the console view in the debug I could see that there was some sort of error in a frame that was being used.
I haven’t got to the bottom of this yet but I was able to access the login page and access wp-admin by switching my re-directed URL for the raw IP address. I expect I have mucked up the re-direct in some way but I’m just relieved to have fixed it to be honest!
Hope this helps someone else!
Jacob J
The error reporting thing solved my problem. Knew I had a misplaced code in there somewhere, and those few lines in the config file showed me where. Thanks a lot. /Jacob
dinesh Kumar
thanks a lot i found error wp_debug already defined and resolved this error and also installed new theme now my site is opening but i can’t access my admin page when i type admin url it’s showing it’s not redirecting properly
Kaley Basham
Ok, so I replaced the theme by replacing the current_theme, template and stylesheet in PHPmyAdmin to twentyeleven and it fixed the white screen of death issue. Now I checked my functions.php document and I had no extra spaces in the end.
So now what?!?!??? Thanks for any help!!
WPBeginner Support
Try downloading a fresh copy of your WordPress theme.
Administratör
Adria
THANK YOU SO MUCH! It was one of the Whatsapp Plug-ins which was causing an issue. I can now sleep peacefully tonight – my site is up and running again.
Timothy
Thanks for this. I ran the error code and found a malicious file. link-template.suspected.
I removed the file and replaced it with a new one that I had downloaded and that fixed.
All this after going through every other thing to no avail.
Replacing the bad file got things back.
stef
Thanks, debug mode works great i could find the faulty php script
Hugo
The blank screen can also be caused by using the wrong version of php. PHP 5.2 has cause me trouble in the past, changing to 5.4 fixed it. Be sure to check this if all else fails.
Kelly
Another vote for PHP version. I tried almost everything and was about to replace the theme when I gave this a go. Upgraded to 5.5 and like magic, it was fixed! Thanks Hugo.
Bobby
Coded my own theme and had blank screen when trying to update posts and pages, deleting spaces at the bottom of my functions file solved the issue!
Jonas Holm
I went through all the above steps without succes. I downgraded PHP 5.6 to 5.3 on my providers PHP-admin-page. That solved my problem.
Grace
I’ve read through all of this but sadly my problem is that I can’t even log on anymore – I got the white screen of death but it says that when you try to go onto my page and when I even try to go to the Wordpress dashboard (via Godaddy). I now have absolutely no way to log on to my wordpress – not sure what to do!
Tawanda
I just fixed this problem, it was a caching issue. If you go to your wp-config.php file then remove the code just above the define(’DB_NAME’, ’your_db_name’);
This should work, as it worked for me
Nhan Nguyen
It worked fine for me. Many thanks.
jake
No code there
Jan Fallon
I had the WP CACHE code in my wp-config.php file – just above the define(‘DB_NAME’, ‘your_db_name’); as stated by TAWANDA and removed it – and so far my home page, which was completely white, is holding!
I could log in via admin, and saw all my content, but at the URL the home page was white.
FIXED with crossed fingers!
Many thanks wpbeginner crowd!
Jan
Juan Jose Hernandez Cruz
I cannot even log in I have a blank screen. what do you suggest please help
LaQuata
I had the same issue and I did the replacing the theme. This work for me.
Sam
Had this same problem when updating my wordpress plug-ins. I accidently clicked on a link while a couple of plug-ins were updating. The site was okay but could not get into the admin section. Log-in was blank. After reading this article tried changing the plug-ins file name. Admin was still blank and site now wouldn’t load. Change the plug-in folder back to its correct name.
I didn’t delete the theme since this would be a headache to ressurect, I have text widget areas with code and all of this would delete. Instead skipped to the error fix, under ”other suggestions” and placed the script in the wp-config.php file. An error popped up for a ”google analytics plug-in”. I ftp’d in and changed the name of the folder for that plug-in which fixed the problem.
I could now log-in to the admin area. I then checked the name of the plug-in and found the plug-in through the wordpress ”new plug-in” feature. Loaded it in then deleted it. Did this to clear it out of the database. Haven’t reinstalled it yet. Enough headaches for one day
Hope this helps someone…
Paola
I have a problem inside my WordPress admin panel. I can get in but then I get the
white screen of death when I try to edit comments and the like and I cannot
seem to get to use my dashboard. I have tried deactivating plugins and also
re-installing a fresh copy of WordPress but this didn’t seem to help. I also tried replacing my
current theme with a default twenty ten theme but that seemed difficult and I
am not sure I was able to do so. The article also suggested
using the WordPress debug function to see what type of errors are being
outputted. I did manage to add the suggested code in my wp-config.php file and
I got some messages but I am not very good with code so I don’t really
understand what is being said. Any suggestions?
Henry
did you try increase the memory by
define(‘WP_MEMORY_LIMIT’, ‘128M’); in wp-config
Pat
I tried everything listed on this post to no avail. I finally found the
fix for my situation! My problem was related to an older versions of
WP: 3.3.1.
I looked at the error_log file in the wp-admin
directory and saw the following error: ”PHP Fatal error: Access to
undeclared static property: WP_Screen::$this in
/home2/bellex/public_html/wp-admin/includes/screen.php on line 706”
I had things setup using the WordPress debug function described above.
Anyhow this error led me to a website that directed me on how to alter the screen.php file. See this site for details:
http://wordpress.stackexchange.com/questions/127427/how-to-fix-empty-dashboard-issue-in-wordpress
Gerle Haggard
Like Nese, this simply explained solution was the answer, Thank you, thank you!
Steven
Remove the extra spaces at the bottom of function.php save my life! Many Thanks!
WPBeginner Staff
Yes you can delete and reinstall a theme. However, you will also loose any other customizations you made to the theme.
Veronca
Thanks a lot for the help. I add some code to my Cron Job. I deactivated all my network plugins and asked hostgator to increase my memory. The last thing I need is the white screen of death during production. My site has been down all day, but now its back up. THANKS AGAIN!!
Bboo
Can I just delete the the entire theme file. And re-install it? Will that fix the white screen? I was working on the .php, but now looking at the files, i have NO IDEA which one i was in!!
Nese
Thank you so much. This post and this comment solved it for me.
You’ve made my day.
Bboo
How is everyone having to option to see pages?? When I login I ONLY see BLANK PAGE. No options, no links, no files. NOTHING!! Someone please help!!
Eduardo Flores
A month later but… Maybe you have to check your files via FTP
WPBeginner Staff
You can use an FTP client to access files on your web server. Locate the file you edited earlier and undo the changes you made to it.
You can also use the File Manager in your web hosting account’s cPanel dashboard.
WPBeginner Staff
You can use the File Manager from your cPanel account to edit the php file.
Morgan
I fixed my white screen of death by deleting the code I had written just before it crashed. I did that through the Bluehost file manager. I found my website file (the wordpress install file), then went into wp content, found the theme I was using, then opened the functions file (to fix the theme’s function .php file).
Piotr
Hi there, I am having the same problem and tried literally everything how did you fix the functions file?
Laura
Thanks!!! That’s exactly what I had to do – thanks for spelling it all out for me!
Morgan
I just found this article about how to do things on the site through Bluehost. But since I know it’s not a plugin problem; I know it’s my .php file, is there something else I can do? Is there an outside way to access my .php file (via Bluehost)? I’m sorry but I am freaking out over here.
https://my.bluehost.com/cgi/help/white-screen-of-death
Morgan
Hi, thank you for telling me what this is. I tried putting in the code from your how-to-avoid-no-thumbnail-issue-while-sharing-post-on-facebook post, and I’m sure I’ve corrupted a file doing something wrong. I can’t get anywhere, it’s all white. How do I disable plugins or go to a default theme this way? I’m going to lose so much work, aren’t I?!???
Mark
Rather than deleting a potentially broken theme, you can just rename it. WordPress will still fall back to a default and it saves the bother of backing up & deleting.
imLOST
I had extra spaces at the bottom of my functions.php file.
After the closing ?> tag. Cleared them up and all was good!
Hasan Shahzad
I have got it fixed by renaming plugins folder to plugin, Wordpress deactivated my all plugins and I was able to access WP-Admin, I tried to activate all plugins manually, however one plugin returned fatal error while activating itself ”(include_path=’.:/usr/lib/php:/usr/local/lib/php’)” Then I got it, that plugin was creating mess. Now my blog works fine.
WPBeginner Staff
Check out How to Fix Syntax Error in WordPress
Beetzy Chase
Thank you for the article. I did fix my site. Your article just got my fix it thoughts going in the correct direction, nice reads like this make programming a little less lonely
gaurav
Hi Admin,
please help
Just Now I got an error. my wordpress site is not working even wp-admin also not working, i was doing some changes on footer and have done small change. after saving my wordpress editor. my site not opening and also wp-admin not opening,
I am getting this error Parse error:
syntax error, unexpected end of file in /home/content/p3pnexwpnas01_data02/60/2213460/html/wp-content/themes/fashionistas/functions.php on line 295
i am using wordpress managed hosting from godaddy.
When i am trying to open wordpress admin and my website. both are not opening, returning that error only .
Please help.
Thanks in advance
Anindyo Yudhistiro
I have add
error_reporting(E_ALL); ini_set(’display_errors’, 1);
define( ’WP_DEBUG’, true);
on my wp-config file, but still didn’t get the error..