Code Corner
Web and desktop tips and tricks for programmers and newbies: CSS, HTML, PHP, ASP.NET, jQuery, JavaScript, C#, JAVA, ASP, Visual Basic, SQL and sundry other language oddities
Web and desktop tips and tricks for programmers and newbies: CSS, HTML, PHP, ASP.NET, jQuery, JavaScript, C#, JAVA, ASP, Visual Basic, SQL and sundry other language oddities
Ever get stuck outside the WordPress login screen, looking in, wondering why you’re getting that “Cookies Not Enabled” error?
More often than not, especially if you like to tinker or (heaven forbid), actually DESIGN themes, it’s due to an error SOMEWHERE in the PHP code of your theme. Which means, of course, it could literally be ANYWHERE. And, of course, it could be one of those whiz-bang new plugins you just installed, too!
The “Cookies Not Enabled” error message is often a BOGUS, misleading error — but give your browser a quick check anyway. It’s usually YOUR THEME or PLUGINS that are the problem
But before you go through the arduous task of rummaging through your theme code or removing plugins one by one looking for the error, here’s an easy way to see if your theme is at fault:
IDEAL solution:
Download and save all themes on your site. Then DELETE ALL OF THEM (or, if you know which theme was activated last–just delete that theme) and upload the current WordPress default theme (depends on your installation). This is supposed to work if the active theme “disappears” from your site.
The WordPress “default theme” solution didn’t work for me–so here’s what did:
1. If you know the exact name of the last theme you activated, then skip Steps 2 & 3 and go directly to Step 4
2. If your theme is displaying when you navigate to your site, but you get the “cookie” error when you try to log in, that’s GREAT–take a look inside the page source and determine which theme is being used (the directory will be shown somewhere). Check the style.css file to get the EXACT name of the theme.
3. If the theme IS NOT displaying, and you have the “white screen of death”–don’t panic. Get into Filezilla (or other file transfer tool) and take a look at the themes you have installed on your site. Try to remember which theme you activated LAST.
The last theme you activated is PROBABLY the problem
4. Download the theme that’s showing on your site, or, if you don’t remember which one you activated last, download ALL of them to a safe place.
5. DELETE the theme FROM YOUR SITE that you think is causing the problem. If you don’t know which one it is, then delete ALL of them. Be sure you have copied them to your local disk FIRST.
Always have a “known good” theme on hand–whether it’s one of WordPress’ own, or a simple theme that you’ve designed yourself. The simpler, the better.
6. Take a “know good” theme and RENAME it in its style.css file to the name of the last theme you activated. Upload it to your WordPress installation into a directory that has the same name as the offending theme, if possible. If the offending theme’s directory had spaces in it, use a different name. (Theme directories should NEVER have spaces in them)
7. If you can’t remember the name of the last theme you activated, work through the list of themes you downloaded one at a time, changing the theme name in the “know good” theme’s style.css file and uploading it to a theme directory on your site until you find your culprit. BE SURE you copy the theme’s name EXACTLY as it appears in its own style.css file.
That’s what worked for me! As soon as I deleted the “bad theme” and loaded a “known good” theme with the same name, the error went away and I was able to log in and change the active theme to one that worked.
Remember: the “Cookies Not Enabled Error” is often bogus!