Are you getting the cookies blocked error on your WordPress?
Thanks to digital technology and the greater presence of mobile devices on a daily basis, more and more people use the internet as a source of information and to interact with brands.
That is why it is so important to develop a secure website for your business and build a strong online presence, especially through platforms such as WordPress.
To make the most out of these tools, it is also essential to understand some of their main components, such as cookies. They are present in basically all websites to optimize access and conversion.
However, you may see an error message on WordPress when you sign in, stating that cookies are blocked. Although it seems like a big problem, it rarely is that serious. You just need to know the right way to solve it. To help you with that, we’ll explain how to do this.
In this article, you will see:
- What are cookies?
- Why do cookies get blocked?
- How to solve the “cookies are blocked” error on WordPress?
Keep on reading to understand everything you need to know about the topic!
What are cookies?
As you access a website, it automatically downloads a small and temporary file to your browser, which is an HTTP cookie. In general, it’s a text file that nearly takes up any space in your computer and does not get in the way of your browsing.
Its purpose is to act as a record of key navigation information and the user’s profile, such as their location, age, and browsing history. With this data, you can gain a deeper understanding of your leads and optimize marketing campaigns and content, among other things.
Why do cookies get blocked?
Unfortunately, it is hard to pinpoint one single cause for the “cookies are blocked” error on WordPress without the entire context. Many things can lead up to their blocking, from a configuration error in the SSL certificate to an important corrupted file.
Generally, identifying the most likely cause is part of the process of solving this problem. Also, the blocking may be the result of some security plugin protocol.
This is more common when the HTTP cookie in question presents some harmful behavior, such as capturing login data, or when the plugin itself presents some issue.
How to solve the “cookies are blocked” error on WordPress?
Whatever the cause of the error may be, once it is identified, it is not so difficult to solve. Even in doubt, there are still some methods you can apply to solve this situation. Check out the main ones and how they are executed.
Set the domain
First, just try to refresh the page to make sure it was not a one-time error in the code’s execution. If that does not work, the problem may be in the definition of the domain used in your cookie.
To solve this, you must access the wp-config file on your computer and add the following line of code:
- // Set cookie domain for login cookies
- define( ‘COOKIE_DOMAIN’, ‘.domain.com’ );
Where you read “domain.com”, you must insert your website’s domain itself, so that the cookie can find it. Remember to put the code before the line “/ * That’s all, stop editing! Happy blogging. * / ”, which indicates the end of the file.
Another possible method, yet not ideal, would be to ignore the setup of cookies on the website, allowing you to log in without them while you do not solve the problem permanently.
To do this, you must access the file functions.php on your WordPress theme and add the following line of code:
- setcookie(TEST_COOKIE, ‘WP Cookie check’, 0, COOKIEPATH, COOKIE_DOMAIN);
- if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, ‘WP Cookie check’, 0, SITECOOKIEPATH, COOKIE_DOMAIN);
It can be a little difficult to make changes to PHP safely. So, to make things easier, it is recommended to download the plugin Code Snippets. It allows you to make these additions more easily and also manage each one. That way, when you need to, you can disable these lines of code separately.
In some cases, the “cookies are blocked” error on WordPress occurs because they are not specifically enabled on your browser. If they cannot be executed, the login to WordPress can present problems.
This can happen when your browser cannot find the site’s authentication protocols. Fortunately, this can be solved with four steps:
- access your PHPMYADMIN;
- open the table WP-OPTIONS in your database;
- go to OPTION_VALUE, double-click and add the hosting protocol before your URL;
- repeat the previous step on the next line so that both are the same.
This should do the trick.
There are other several small possible procedures and they do not require such an in-depth explanation. Therefore, we have selected some of them as follows:
- delete the .htaccess file and create a backup copy. If it works, save the permanent link and it will create a new file;
- check if your SSL plugins are redirecting to HTTPS correctly;
- rename your plugins folder so that they are all disabled and then activate each one at a time. This helps to solve the error if it was caused by a security plugin;
- rename the folder with the theme files and WordPress will return to the default setting. If this solves the problem, delete the folder and reinstall the theme. It is rare, but the “cookies are blocked” error on WordPress can be caused by your theme.
With this content, you already have some ideas on how to solve the “cookies are blocked” errors on WordPress and normalize your access. However, if they persist, it is a good idea to seek technical help or contact the support from the platform.
To help avoid more problems like this one, check out our complete WordPress guide for corporate blogs and feel even more prepared to work with this platform.