Have any question?
How to Fix 504 Gateway Timeout Error on WordPress- The Comprehensive Guide

How to Fix 504 Gateway Timeout Error on WordPress – The Comprehensive Guide

How to Fix 504 Gateway Timeout Error – Comprehensive Guide.

There is nothing more frustrating and annoying than browsing on your WordPress website and encountering a white screen with an error message – 504 Gateway Timout Error.

For many blogs and e-commerce sites these errors result in the loss of sales and revenue from visitors instantly bouncing and customers unable to complete their purchases.

how to fix 504 gateway timeout error on wordpress

Here we will get into what is 504 gateway timeout error, the causes of 504 gateway timeout error and some recommendations on how to fix 504 gateway timeout error on your WordPress site.

Read more below about what causes this error and what you can do to prevent it in the future.

  1. What is 504 Gateway Timeout Error?
  2. 504 Gateway Timeout Error Variations
  3. Causes for 504 Gateway Timeout Errors?
  4. How to fix 504 Gateway Timeout Error?

What is 504 Gateway Timeout Error?

Hypertext Transfer Protocol – HTTP status codes starting with 5 are server-side errors.

They appear when the request cannot be performed due to a connection failure between several servers.

In simple term, this means that the server could not complete your request within the stipulated time period.

504 gateway timeout error

There are many error messages that you might see but some common errors that you might encounter are:

  • The White Screen of Death.
  • Error Establishing a Database Connection.
  • Too Many Redirect Error.
  • 502 Error Bad Gateway.

504 Gateway Timeout Error Variations

Due to all the different web browsers, operating systems and servers – a 504 gateway timeout error can present itself in a number of different ways. They will all still have the same meaning.

Below are just a few of the many different variations you might see pop up:

  • 504 Gateway Timeout
  • 504 Gateway Timeout NGINX
  • NGINX 504 Gateway Timeout
  • Gateway Timeout Error
  • Error 504
  • HTTP Error 504
  • HTTP Error 504 – Gateway Timeout
  • HTTP 504
  • 504 Error
  • Gateway Timeout (504)
  • This page isn’t working – Domain took too long to respond
  • 504 Gateway Time-out – The server didn’t respond in time
  • A blank white screen

Some companies even have custom pages for 504 gateway timeout errors.

504 gateway timeout custom page

Causes for 504 Gateway Timeout Error?

Before we consider the error itself it is important to understand how they are generated.

Whenever you start your browser and visit a website it sends the request back to the server where it is hosted on.

The web server then processes the request and sends back the requested resources along with what they call an Hypertext Transfer Protocol – HTTP header.

This HTTP header contains one of many HTTP status codes to communicate whether everything is OK or if something has gone wrong.

Not all HTTP status codes are bad. For example a 200 status code indicates everything is OK.

Any status code in the 500’s is error codes (500, 501, 502, 503, 504, 520,etc.) that have different meanings.

These indicate that the request was accepted but the server prevented the execution of the request.

In simple terms a 504 gateway timeout error means that the server – acting as a gateway – timed out waiting for another server to respond.

Server Side Error

The code returns when there are two servers involved in processing a request and the first server times out waiting for the second server to respond.

In addition to server timeouts – there are other causes leading to 504 gateway timeout error:

  1. Slow Server.
  2. 504 Gateway Timeout Error PHP Workers.
  3. Problems With The Firewall.
  4. Network Connection.
  5. HTTP Timeouts.
  6. 504 Errors Impact on SEO.

1. Slow Server

It is possible that the server where you host your WordPress website is responding too slowly and therefore it generates gateway timeout errors.

slow server

2. 504 Gateway Timeout Error PHP Workers.

PHP workers are used to running code on your WordPress site. Demanding sites can make all Hypertext Preprocessor – PHP workers busy.

In this case they form a queue and if the queue and backlog are full then the old requests are ignored.

You can ask your host provider to increase the number of PHP workers. Additional PHP workers for a site allow executing several requests simultaneously.

Therefore it is always advisable to make sure you or your responsible administrator opt for a trusted and reliable hosting provider like Best-Digital Marketing Services who are able to provide the best and are available when needed.

3. Problems with the Firewall.

The firewall on your server may contain errors due to incorrect configuration or rules blocking the connection.

There is also the possibility that your WordPress security plugins might be blocking the communication between servers or even your local or Internet Service Provider – ISP or Internet Protocol – IP address.

To rule this out you can try accessing the site from a different Internet connection. On certain occasions – Distributed Denial of Service – DDOS protection systems can become over-sensitive and start blocking the requests from servers.

Best SSL Certificates Prices

With Best-Digital Marketing you will never encounter the http 504 gateway timeout error due to server inadequacy as we provide dedicated servers with SSD storage, unlimited bandwidth, daily offline backup, daily malware scanning and clean-up, Let’s Encrypt SSL and 24/7 customer support by our experts with a starting price of just £39.99.

4. Network Connection.

If there is a problem with the network connection between the proxy server and the web server then this can lead to delays.

There may also be network problems with the load balancer – if it is used.

5. HTTP Timeouts.

This can occur when the connection between your browser and the web server is held open for too long. These commonly happen when running WordPress imports.

One way to resolve this is to switch to a faster internet connection or you can use a tool with support for WP-CLI such as the WordPress Importer plugin and run the import directly on the server – bypassing the HTTP connection entirely.

6. 504 Errors Impact on SEO.

Unlike 503 errors which are used for WordPress maintenance mode and tell Google to check back at a later time – a 504 error can have a negative impact on SEO if it is not fixed right away.

If your site is down for say 12 minutes then it is being crawled consistently and majority of the time the crawler will simply get the page delivered from cache or Google might not even have a chance to re-crawl it before it is back up and in this case you are completely fine.

impact on SEO

Should your site be down for an extended period of time say 5 hours or more then Google might see the 504 gateway timeout error as a site-level issue that needs to be addressed.

This will definitely have an impact on your rankings. If you are worried about repeat 504 gateway timeout errors then you should figure out why they are happening to begin with and some of the solutions below can help.

How to Fix 504 Gateway Timeout Error

Where should you start troubleshooting if you see a 504 gateway timeout error on your WordPress site?

Without a great deal of context it can be frustrating and overwhelming where to begin.

Usually these are network connectivity issues and or problem with the server at which the site is hosted.

However it can also be a client-side issue or even a result of a third-party plugin.

how to fix http 504 gateway timeout error

So let us dive in and check out ways how to fix the 504 gateway timeout error and get back up and running.

How to Resolve Http 504 Gateway Timeout Error

There are a few measures that can be taken to get ahead of the 504 gateway timeout error which is caused by either the user or developer’s side.

These are in no particular order or importance since all of them are equally important and can be used in different combinations depending on individual circumstances.

The common fixes given below are divided into two section:

for the users

for developeres or web administrators

504 Gateway Timeout Error Solutions for Users

1. Refresh or Reload the Page

One of the first things you should try to do when you encounter a 504 Gateway Timeout Error is simply wait a minute and refresh or reload the page by pressing F5 or Ctrl+ F5.

refresh -reload the page

It could be that the host or server is simply overloaded with high amounts of traffic and the site will come right back.

Another thing you can do is to paste the website into https://downforeveryoneorjustme.com. This website will tell you if the site is down or if it is a problem on your side.

down for everyone or just me

This website will tell you if your site is out of service or if it is a problem on your side. This tool checks the HTTP status code that is returned by the server.

If it is anything other than a 200 which means Everything is OK then it will mean that your site does not work for everyone.

website status check

2. Clear Your Browser Cache

There is a good chance that the corrupted files stored on your browser might be causing this 504 gateway timeout error.

So by clearing the cache of your browser you might be able to resolve this error.

clear your browser

Moreover you should remove the cookies from your browser since this can also help in resolving this error.

3. Try in Incognito Mode

Another way to fix this 504 gateway timeout error is by starting a new Private or Incognito session in your browser. This should resolve the issue if it is caused by your browser.

private - incognito mode

4. Try Another Browser

You can try to use another browser such as Chrome, Safari, Firefox or Internet Explorer.

try another browser

If you do not see this 504 gateway timeout error when you change your browser then this indicates that the problem was your browser.

You can try to re-install the browser to check if this resolves the issue.

5. Restart Your Network Device

To do this – simply switch off your internet router from the mains for about 45 seconds to 1 minute.

restart your network drive

Then switch the mains back on and ensure you switch your router power button on too and wait for your computer to establish a connection again. This should alleviate the 504 gateway timeout error issues.

6. Disable Proxy Settings

Sometimes you might see a 504 timeout error if you are utilising a proxy service. This is usually rare especially on the client-side.

disable proxy settings

However one might have been set without you even knowing it. Follow these tutorials on how to disable or check to ensure no proxy settings are enabled:

7. Clear Local DNS Cache

You can also try flushing your local DNS cache to see if this resolves your 502 bad gateway error issue. This is similar to clearing your browser cache.

In Windows simply open up CMD or Command Prompt and enter the following:

ipconfig /flushdns
clear local DNS cache
Command prompt > ipconfig / flushdns

You should see a Successfully flushed the DNS resolver Cache – if it worked correctly.

For MacOS users you can enter the following in the terminal:

dscacheutil -flushcache

Note
: There is no success message on Macs.

Finally you can temporarily change your client side DNS servers. By default DNS servers are automatically provided by your ISP but you could temporarily change them to a public DNS server provided by Google.

Most people prefer to use Google’s public DNS constantly because in the long term they are more reliable and a lot faster.

8. Check On Different Devices

Try opening the site on different devices like laptops, tablets or on mobile.

If nothing could help to fix the 504 gateway timeout error then this step will confirm and help you determine if the problem is on the server side or it is from your side.

9. Check DNS Issues

A 504 gateway timeout error could also be because of a Domain Name System – DNS issue such as the domain is not resolving to the correct IP address.

Configurate The correct DNS

If you have just migrated your WordPress site to a new host provider then is it important to wait for things to fully propagate which can take up to 48 hours in some cases. 

This will depends upon the Time to Live –TTL value of your DNS records and also check and see if there is no typo errors.

504 Gateway Timeout Error Solutions for Developers

If you are a developer or a server manager and you are facing the 504 gateway timeout error then the chances that you might be facing this error is because of other factors.

So trying the following solutions should eliminate the issue.

1. Check Your Server

You can determine whether your server is reachable or not by conducting a trace-route or ping test on the server IP.

ping test

2. DNS Propagation Check  

A 504 gateway timeout error can often be caused by problems with the Domain Name System –DNS server. There are two reasons for this.

This happens on the server side when the domain name is not changed to the correct IP address.

DNS propagation check

If you have just migrated your WordPress website to a new host provider then it is important to wait so the address can be added to DNS base.

In most cases it can take up anything between 24 to 48 hours depending on your host provider and the DNS records Time to Live –TTL value.

DNS Check

You can use the DNS test tools like DNSMapDNS Checker or MX Tool Box for this purpose. They are free to use to check your DNS are up and running and correctly configured.

3. Check Your Plugins and Themes

Many users believe that third-party plugins or themes do not lead to 504 gateway timeout errors and in most cases this is true.

However according to many users’ and our experience a slow non-cached plugin request can cause these delays since it uses more of your PHP workers.

Once you reach the limit of PHP workers the queue will remove your old requests which will cause the 504 errors. They should not be confused with 502 errors which are the result of a 60 seconds timeout.

There are several ways to fix the issue and one of them is to de-activate all your plugins. Remember that you will not lose your data if you disable them.

A. WordPress Admin Panel

You can do this by accessing your admin through WordPress dashboard, a quick way to do this is to browse to Plugins and select Deactivate from the bulk actions menu.

wordpress wp admin

This will disable all of your plugins and if this fixes the issue then you will need to find the culprit.

Start activating each plugin one by one and reload or refresh the website after each plugin has been activated.

wordpress admin panel

When you see the 504 gateway timeout error returns then you have found your problematic plugin. You can either contact the respective plugin developer for help or create a support ticket in the WordPress repository.

B. FTP Client

If you do not have access to the admin panel you can use the File Transfer Protocol – FTP client to connect to your server and rename the plugin folder to something like plugins_old and re- check your site again.

If it works then you will need to test each plugin one by one. Rename your plugin folder back to plugins and then rename each plugin folder inside of if it – one by one until you find the culprit.

You could also try to replicate this on a staging site first.

FTP client

Make sure that all your plugins, themes and the WordPress core are updated to the latest version and ensure that you are running a supported version of PHP.

If the plugin contains bad code then you may need to contact the WordPress developers to solve this problem.

4. Check Error Logs

You can also use your error logs which you can view in a section of the hosting dashboard. This can quickly help you narrow down the issue especially if it is a plugin issue on your website.

If your hosting provider does not have a logging tool then you could also add the following code to your wp-config.php file to enable the WordPress debug mode:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
error logs

Logs are usually located in /wp-content folder or sometimes they can be in separate folders.

You can also check the Apache and Nginx logs which are most often located at:

Apache:-  /var/log/apache2/error.log  or

Nginx:- /var/log/nginx/error.log

5. Check Nginx Settings

If you are managing your own server and WordPress sites on Nginx + FastCGI (php-fpm) or Nginx as proxy for Apache then there are some additional settings you can change to help prevent 504 gateway timeout errors.

A. 504 Gateway Timeout Error on Nginx + FastCGI (PHOP-FPM)

B. 504 Gateway Timeout Error on Nginx Proxy

If you are using Nginx as a proxy for Apache then you need to add the following to your nginx.conf file:

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

Then simply reload or restart Nginx.

service nginx reload

6. Check Issues With Your Hosting Provider

Server issues are one of the most common reasons why users experience a 504 gateway timeout errors on their WordPress websites. In simple terms – Nginx or Apache waits for a response until the waiting time has expired or timed out.

We get a lot of clients that come to Best-Digital Marketing Services due to the fact that they are constantly receiving these errors at their current WordPress hosting site.

504 errors mostly occur on high traffic online and e-commerce stores with a lot of daily visitors.  The latter may have also installed numerous e-commerce plugins like Woo commerce plugins.

These usually have many non-cached requests which can cause the server to overload however such error can also occur in a variety of different types of website including blogs.

Many hosts usually offer to upgrade to a more expensive tariff plan to fix this problem and this usually helps to solve this issue which is often not necessary.

Web Hosting Packages 2

Here at Best-Digital Marketing Services we utilise truly unlimited web hosting this means that every WordPress site is housed in its own isolated location that has all of the software resources required to run it (Linux, Nginx, PHP, MySQL).

Many shared WordPress hosts do not have this capability and therefore a high-traffic neighbouring site causing 504 gateway timeout errors could very well impact your site.

Your sites are isolated and our infrastructure is built to easily handle thousands of concurrent connections. Even MySQL databases are hosted at localhost.

This ensures that there is no latency between machines which results in faster queries and less chance of timeouts occurring anywhere in-between.

Many clients who migrate to Best- Digital Marketing see huge decreases in their overall load times.

A. Website Monitoring & Downtime Alert Tools

It is also important to note that 504 errors can deceptively look a lot like 503 service unavailable errors or even 502 bad gateway errors but they are in fact different.

If you want to prevent such errors from happening on your site in the future then you can also utilise tools like updown.io or statuscake.com to monitor and notify you immediately if problems occurs.

It periodically sends an HTTP HEAD request to the URL of your choice or simply use your homepage.

website monitoring and downtime alert

The tool allows you to set check frequencies of:

  • 15 seconds
  • 30 seconds
  • 1 minute
  • 2 minutes
  • 5 minutes
  • 10 minutes

It will send you an email if and when your site goes down. Here is an example below.

updown.io

This can be especially useful if you are on a shared or virtual hosting which tends to overcrowd their servers.

That is why we always recommend going with a managed WordPress hosting or dedicated hosting.

7. Temporarily Disable CDN or Firewall

It could also be an issue with your Content Delivery Network – CDN. If you are using a third party CDN provider then an easy way to troubleshoot this is to temporarily disable your CDN.

For example if you are using a free CDN enabler plugin on WordPress then you can simply deactivate the plugin and test your website.

disable CDN

If you are unable to access your site’s dashboard then simply log in to your site via Secure File Transfer Protocol –SFTP and rename the plugin’s folder to cdn-enabler_old.

This will temporarily disable the CDN connection. The same goes for WP Rocket or any other plugin you might have hooked up to your CDN.

This could also happen if you use the back proxy services like Cloudflare or Sucuri since they use the additional firewall in between. Most of them cache 500 status codes when they are returned by your origin server.

cloudfare

Many users have noticed that this issue happens once in a while on Cloudflare’s free plan service. Unfortunately since Cloudflare is a complete proxy service there is no quick way to disconnect it.

However before you go pointing the finger at Cloudflare – it is important to know that there are two different types of 504  gateway timeout error variations as shown below:

A. 504 Gateway Timeout at Cloudflare (Variation 1)

If you see the following screen then this is actually a problem on Cloudflare’s end which means that you should reach out to them for Cloudfare support or check their status page.

504 gateway timeout

B. 504 Gateway Timeout at Cloudflare (Variation 2)

If you see the following screen then this is a problem with your WordPress hosting server – in which case you will need to skip over to recommendation No: 5 above.

504 gateway timeout v2

Most likely they are already aware of the issue and have their team working on it.

C. 504 Gateway Timeout at Cloudflare with Uploads

Another reason for a timeout could be related to the size of your uploads. They do restrict POST (uploads) to 100MB on their Free or Pro plan. 

We have occasionally seen clients have issues with files or upload smaller than this and the issue lies with your host’s end or Cloudflare.

An easy way to determine this would be by simply bypassing Cloudflare with your DNS hosts file and trying your upload again or simply disable Cloudflare temporarily.

If you are using Cloudflare with WordPress then it is always recommended to use their free plugin and exclude important URLs from caching such as your WordPress admin area.

cloudfare upload size

8. Spam, Bots and DDoS Attacks

Perhaps your website is been spammed by bots or undergoing a DDoS attack which can lead to uncached requests and server overload. And this results in a 504 gateway timeout error.

You can take a look at your server analytics and see if there are any patterns emerging by asking your hosting provider for this information or data.

The first report we recommend looking at is the top end client IP addresses. This can be useful especially if your site suddenly began to generate large bandwidth or traffic or getting attacked by bots.

top client IP

The second report we recommend to look at is the requests and bots. You can quickly compare the traffic to your website with the number of bots.

However remember that not all bots are bad. Google Bot is a good example as it scans the site to index the content and promote it in the search engine.

google bot

The third report we recommend is the cache analysis. Here you can see what requests are missing the cache, bypassing the cache and also the top locations of your site.

For the best performance and stability reasons you should try to cache as many requests as possible.

This is not always possible since some sites such as those running Woo Commerce are generating a lot of un-cached requests.

They have to for the features like the shopping cart and checkout process to work correctly and stay in sync.

cache component attack analysis

A. Blocking Spams and DDOS Attacks

If you find and identify traffic or IP addresses that need to be blocked then you can use the WordPress security plugin.

However not all hosting providers allow you to install security plugins since such plugins can influence the speed and performance of your website especially when they scan the server.

Secondly the IP blocking feature may not work because hosting provider can use load balancers from the Google Cloud Platform.

IP addresses can always be blocked by the hosting support service but depending upon the length and scale of the attack this could be a never-ending process of blacklisting IPs which in most cases does not solve the problem fast enough.

sucuri

When the attacks or spam is blocked in one area, they are often switched to other zones – changing IP addresses or using other proxy addresses.

Therefore we recommend installing a security solution such as Cloudflare or Sucuri.

9. Contact Support Team

If you are still constantly getting 504 gateway timeout error and you have exhausted all the above options and nothing else helps to fix it then contact your hosting technical support team.

Describe to them all the steps you have taken to identify the error caused and provide them with as much information as possible.

This will greatly speed up your request and the process o resolve this issue.

Conclusion

As you can see there is a multitude of different ways and methods – how to fix 504 gateway timeout errors on your WordPress site.

Usually these are a server issue in which case you can quickly reach out to your hosting provider to get it resolved.

But it is also important to remember that they can actually be caused by third-party plugins or overwhelming backlog or queue overflow of your PHP workers.

If you are having these issues then contact us today or our support team who specialises in web performance optimisation.

If you enjoyed this post then share this on your social media and you will love Best-Digital Marketing’s hosting platform. Turbocharge your website and get 24/7 support from our hosting team.

For full Web Hosting Services package functionality

and select the package that suits your business needs.

If you prefer to discuss your requirements first just

or fill your details with a message of your requirements at

Further Reading: Benefits of SEO

For more information about our services and how we can help you with Web Hosting Service needs:-

Join Our Blog Email List

I might send you 1 or 2 emails a month. Most probably less. Lots of tricks, tips, humour hacks, guides and exclusive ramblings in there for your good mental health and education.

limited time offer - time sensitive
education

You can unsubscribe anytime whenever you like. No risk or regrets. We will never spam your Inbox.

Hope you are enjoying and learning a lot with abundance of information about:-

How to Fix 504 Gateway Timeout Error on WordPress- The Comprehensive Guide.

 

How To Fix 502 Bad Gateway Error

How to Fix 502 Bad Gateway Errors on WordPress Website

How to Fix 502 Bad Gateway Error

When it comes to WordPress there are a lot of different errors that can be frustrating and confusing. Another popular one is the 502 bad gateway error.

Why?

This 502 bad gateway error occurs frequently around the internet and also in services such as Gmail, Twitter and Cloudflare.

How To Fix 502 Bad Gateway Errors On WordPress Website

In this post we will discuss everything you need to know about the 502 bad gateway error what causes this error and some solutions on how to fix and resolve it.

  • What is a 502 Bad Gateway Error?
  • Causes For 502 Error Bad Gateway?
  • How To Fix The 502 Bad Gateway Error?

What is 502 Bad Gateway Error?

Every time you visit a website your browser sends a request to a web server. The web server receives and processes the request and then sends back the requested resources along with the Hyper Text Transfer Protocol – HTTP header and HTTP status code – 502 Bad Gateway Error.

This error states there has been an inadequate response from the other server that something has gone wrong along with the code on how to diagnose it. You can see this error on any device, browser and operating system.

502 bad gateway error in Chrome

There are many different types of 500 status error codes – 500, 501, 502, 503, 504, 520, etc which all have slightly different meanings.

In this case a 502 bad gateway error specifically means that one server while acting as a gateway or proxy has received an invalid response from an inbound server.

502 Errors Impact on SEO of your website

A 502 error can have a negative impact on SEO if not fixed right away.

In the event that this error occurs continuously on your site then it will influence the reputation of your webpage for users as well as for search engines like Google. In the end it would lead to a poor user experience – UX for the customers.

This could impact your rankings. If you are worried about the repeat of 502 bad gateway error then you should figure out why they are happening to begin with and then resolve them as soon as possible.

Server Side Error

Most of them represent a server error response and each individual response stand for different server errors which are resolved in different ways.

All server sided errors can only be resolved by webmaster or app builder due to limited server access.

Causes for 502 Bad Gateway Errors

It is an error that you might see because the server was not able to provide a valid response to the request.

There are several other reasons that might lead to a 502 error but here are the most common reasons.

  1. Origin Server Is not Working
  2. Domain Name
  3. Block Request By Firewall
  4. Server Failure
  5. Error in Browser

Origin Server Is Not Working

One of the common reasons is that the server is not working as it should which means the server is not accessible.

There are many explanations for this – like the server is down or there is a connectivity problem or there might be a very high amount of traffic on the server.

server down

Domain Name System - DNS

Another reason for seeing a 502 bad gateway error is that the domain is not determining the right IP address.

This usually occurs due to incorrect DNS records being set at the domain hosting level.

If you have set the correct DNS records then keep in mind that changes in DNS can take time to propagate globally and this relies on various factors including Time to Live – TTL especially when moving to a new hosting provider.

DNS domain name system

Therefore it is always advisable to make sure you or your responsible administrator opt for a trusted and reliable hosting provider like Best-Digital Marketing Services who are able to provide the best and are available when needed.

Block Request by Firewall

The firewall is used to block the transmission between the servers and it is another common reason to face the 502 bad gateway error.

There is also the possibility that your WordPress security plugins might be blocking the communication between servers or even your local or Internet Service Provider – ISP or Internet Protocol – IP address.

To rule this out you can try accessing the site from a different Internet connection. On certain occasions – Distributed Denial of Service – DDOS protection systems can become over-sensitive and start blocking the requests from servers.

Web Hosting Packages

With Best-Digital Marketing you will never face the http 502 bad gateway error page due to server inadequacy as we provide dedicated servers with SSD storage, unlimited bandwidth, daily offline backup, daily malware scanning and clean-up, Let’s Encrypt SSL and 24/7 customer support by our experts with a starting price of just £39.99.

Server Failure

You might experience a 502 bad gateway error if a server has completely failed and this can be due to a system crash or servers been taken offline for maintenance or similar reasons.

This can also be because the content of the server might be violating the server provider’s terms and conditions.

server down for maintenance

Error in Browser

Occasionally some browser extensions can also lead to a 502 bad gateway errors when rendering the website especially with Ad Block extensions.

Apart from this there may be the rare occasion where the browser is outdated which is causing the 502 bad gateway errors.

We have discussed the causes of 502 bad gateway errors – now it is time to resolve and fix these 502 bad gateway errors and issues.

502 Bad Gateway Error Variations

Due to the various browsers, web servers and operating systems a 502 bad gateway error can present it in a number of different ways but they all have the same meaning.

If you are experiencing a Server Error or 502 Error when trying to access a site then it means that you are seeing a 502 bad gateway error.

Below are the different variations you might see on the web:

  • 502 Bad Gateway NGINX
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • HTTP 502
  • 502. That’s an error
  • 502 Bad Gateway Cloudflare
  • Bad Gateway: The proxy server received an invalid response from an upstream server
  • Temporary Error (502)
  • 502 Bad Gateway
  • Error 502
  • HTTP Error 502 – Bad Gateway
  • 502 Service Temporarily Overloaded
  • 502 Proxy Error
  • A blank white screen

Here is another variation – 502 – Web server received an invalid response while acting as a gateway or proxy server.

There is a problem with the page you are looking for and it cannot be displayed. When the Web server – while acting as a gateway or proxy contacts the upstream content server, it receives an invalid response from the content server.

502- web server received an invalid response

Another variation you might see is a 502 server error

502 server error in Chrome

Here is a snapshot of how Google displays it – 502. That’s an errorThe server encountered a temporary error and could not complete your request. Please try again in 30 seconds. That’s all we know.

Google 502 bad gateway error

Other services like Twitter might even show a completely different message for a 502 Bad Gateway error – Twitter is over capacity and this definitely looks a little more user-friendly.

twitter is over capacity

How to Fix the 502 Bad Gateway Error

There are a number of things that you can try to resolve this problem. Usually a 502 bad gateway error is a result of bugs in the PHP or the server configuration or network error on the server side.

However it could also be a customer or client side issue like problems with your browser or your ISP or local IP that might be blocking it as mentioned above.

how to fix http 502 bad gateway error

So let us dive in and check out ways how to fix the 502 bad gateway error and get back up and running.

How to Resolve Http 502 Bad Gateway Error

There are a few measures that can be taken to get ahead of the 502 bad gateway error which is caused by either the user or developer’s side.

The common fixes given below are divided into two section:

for the users

for developeres or web administrators

502 Bad Gateway Error Solutions for Users

1. Refresh or Reload the Page

One of the easiest and first things you should try when encountering a 502 bad gateway error is to simply wait a minute or so and then reload or refresh  the page by pressing F5 or Ctrl + F5.

refresh -reload the page

It could be that the host or server is simply overloaded with high amounts of traffic and the site will come right back. While you are waiting you could also quickly try a different browser to rule that out as an issue.

Another thing you can do is to paste the website into https://downforeveryoneorjustme.com. This website will tell you if the site is down or if it is a problem on your side.

down for everyone or just me

There is a good chance that the corrupted files stored on your browser might be causing this 502 bad gateway error.

So by clearing the cache of your browser you might be able to resolve this error.

clear your browser

Moreover you should remove the cookies from your browser since this can also help in resolving this error.

Another way to fix this 502 bad gateway error is by starting a new Private or Incognito session in your browser. This should resolve the issue.

private - incognito mode

You can try to use another browser such as Chrome, Safari, Firefox or Internet Explorer.

try another browser

If you do not see this 502 bad gateway error when you change your browser then this indicates that the problem was your browser.

You can try to re-install the browser to check if this resolves the issue.

To do this – simply switch off your internet router from the mains for about 45 seconds to 1 minute.

restart your network drive

Then switch the mains back on and ensure you switch your router power button on too and wait for your computer to establish a connection again. This should alleviate the 502 bad gateway error issues.

A 502 gateway error could also be because of a Domain Name System – DNS issue such as the domain is not resolving to the correct IP address.

Configurate The correct DNS

If you have just migrated your WordPress site to a new host provider then is it important to wait for things to fully propagate which can take up to 48 hours in some cases. 

This will depends upon the Time to Live –TTL value of your DNS records and also check and see if there is no typo errors.

502 Bad Gateway Error Solutions for Developers

If you are a developer or a server manager and you are facing the 502 bad gateway error then the chances that you might be facing this error is because of other factors.

So trying the following solutions should eliminate the issue.

You can determine whether your server is reachable or not by conducting a trace-route or ping test on the server IP.

ping test

2. Check DNS

Another way to resolve this 502 bad gateway error is by checking if your fully qualified domain name is resolving properly or not.

DNS Check

You can use the DNS test tools like DNS Checker or MX Tool Box for this purpose. Both are free to use to check your DNS are up and running and correctly configured.

3. Clear local DNS Cache

You can also try flushing your local DNS cache to see if this resolves your 502 bad gateway error issue. This is similar to clearing your browser cache.

In Windows simply open up CMD or Command Prompt and enter the following:

ipconfig /flushdns
clear local DNS cache
Command prompt > ipconfig / flushdns

You should see a Successfully flushed the DNS resolver Cache – if it worked correctly.

For MacOS users you can enter the following in the terminal:

dscacheutil -flushcache

Note
: There is no success message on Macs.

Finally you can temporarily change your client side DNS servers. By default DNS servers are automatically provided by your ISP but you could temporarily change them to a public DNS server provided by Google.

Most people prefer to use Google’s public DNS constantly because in the long term they are more reliable and a lot faster.

4. Check Your Plugins and Themes

A lot of times the reason for scripts and queries being cancelled by the server is due to bad code on your WordPress site and possibly from a 3rd party plugin or theme.

We have also seen a lot of misconfigured caching plugins generate 502 bad gateway errors.

A few ways you can troubleshoot this is by deactivating all your plugins and remember – you will not lose any data if you simply deactivate a plugin.

A. WordPress Admin Panel

You can do this by accessing your admin through WordPress dashboard, a quick way to do this is to browse to Plugins and select Deactivate from the bulk actions menu.

wordpress wp admin

This will disable all of your plugins and if this fixes the issue then you will need to find the culprit.

Start activating each plugin one by one and reload or refresh the website after each plugin has been activated.

de-activate all plugins

When you see the 502 bad gateway error returns then you have found the culprit plugin. You can either reach out to the plugin developer for help or post a support ticket in the WordPress repository.

B. FTP Client

If you do not have access to the admin panel you can use the File Transfer Protocol – FTP client to connect to your server and rename the plugin folder to something like plugins_old and re- check your site again.

If it works then you will need to test each plugin one by one. Rename your plugin folder back to plugins and then rename each plugin folder inside of if it – one by one until you find the culprit.

FTP client

Make sure that all your plugins, themes and the WordPress core are updated to the latest version and ensure that you are running a supported version of PHP.

If the plugin contains bad code then you may need to contact the WordPress developers to solve this problem.

5. Check Error Logs

You can also use your error logs which you can view in a section of the hosting dashboard. This can quickly help you narrow down the issue for your 502 bad gateway error issues.

If your hosting provider does not have a logging tool then you could also add the following code to your wp-config.php file to enable the WordPress debug mode:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
error logs

Logs are usually located in /wp-content folder or sometimes they can be in separate folders.

You can also check the Apache and Nginx logs which are most often located at:

Apache:-  /var/log/apache2/error.log  or

Nginx:- /var/log/nginx/error.log

6. Check with Your Hosting Provider

The primary reason we usually see a 502 bad gateway error is due to an issue with the web hosting. 

Sometimes when a query, script or request takes longer than it should then it is cancelled or killed by the server.

A lot of hosts especially shared hosts implement what they call a kill script which basically terminates a request after a certain period of time so that it does not take a site down or impact other users. 

If you do a Twitter search for bad gateway you can see thousands of tweets happening every day alerting their hosting company of the problem.

502 bad gateway tweets

One reason you might want to consider moving to a reliable web hosting agency like Best-Digital Marketing Services is that our platform runs in isolation software that contains all of the software resources required to run your site.

This means that the software that runs each site is 100% private and is not shared even between your own sites.

This greatly reduces the chance of seeing a 502 bad gateway error and even if one of your sites does happen to go down – it will not impact any of your other sites.

Many hosts usually offer to upgrade to a more expensive tariff plan to fix this problem and this usually helps to solve this issue which is often not necessary.

Web Hosting Packages

Here at Best-Digital Marketing we utilise truly unlimited web hosting this means that every WordPress site is housed in its own isolated location that has all of the software resources required to run it (Linux, Nginx, PHP, MySQL).

Many shared WordPress hosts do not have these capabilities and therefore the server is simply not reachable either because it is down or there is no connectivity.

7. Temporarily Disable CDN or Firewall

It could also be an issue with your Content Delivery Network – CDN. If you are using a third party CDN provider then an easy way to troubleshoot this is to temporarily disable your CDN.

For example if you are using a free CDN enabler plugin on WordPress then you can simply deactivate the plugin and test your site.

disable CDN

If you are unable to access your site’s dashboard then simply log in to your site via Secure File Transfer Protocol –SFTP and rename the plugin’s folder to cdn-enabler_old.

This will temporarily disable the CDN connection. The same goes for WP Rocket or any other plugin you might have hooked up to your CDN.

This can also occur sometimes with providers that provide DDoS protection and mitigation or fully proxy services like Cloudflare since they have extra firewalls in-between.

Many users noticed that this issue happens once in a while on Cloudflare’s free plan. Unfortunately since Cloudflare is a complete proxy service there is no quick way to disconnect it.

However before you go blaming Cloudflare it is important to know that there are two different types of 502 bad gateway error variations with Cloudflare as seen below:

A. 502 Bad Gateway at Cloudflare (Variation 1)

If you see the following screen, this is actually a problem on Cloudflare’s end which means that you should reach out to them for support check their status page to see if they are currently experiencing any outage.

502 bad gateway error Cloudfare

B. 502 Bad Gateway at Cloudflare (Variation 2)

If you see the following screen then this is a problem with your hosting server.

Cloudflare 502 bad gateway at host

8. PHP Timeout Issue

PHP timeouts occur if a single PHP process runs for longer than the max_execution_time or max_input_time set in the PHP configuration on your server. 

This is a common occurrence if you are carrying out huge WordPress imports and a 502 server error is usually displayed.

If you run into a PHP timeout these values may need to be extended. You can check with your current host to enquire the current values set on your server and if they can be increased.

On our platforms at Best-Digital Marketing  these values are set to 300 seconds or 5 minutes by default. The maximum PHP timeout values available on our platform are based on your current hosting plan.

max_execution_time = 300

Conclusion

There are quite a few things you can do to troubleshoot and fix a 502 gateway error on your WordPress site. Usually this is not on the client-side but rather an issue with your host- server side.

Third-party plugins and themes with bad code or un-optimised queries are also things to watch out for.

If you enjoyed this post then please share it on social media and you will love our hosting platform. Turbocharge your website and get 24/7 support from our expert team.

Our plans have powerful infrastructure focusing on auto-scaling, performance and security. Let us show you the difference – Check out our plans or chat with us today to find the plan that is right for you.

For full Web Hosting Services package functionality

and select the package that suits your business needs.

If you prefer to discuss your requirements first just

or fill your details with a message of your requirements at

Further Reading: Benefits of SEO

For more information about our services and how we can help you with Web Hosting Service needs:-

Join Our Blog Email List

I might send you 1 or 2 emails a month. Most probably less. Lots of tricks, tips, humour hacks, guides and exclusive ramblings in there for your good mental health and education.

limited time offer - time sensitive
education

You can unsubscribe anytime whenever you like. No risk or regrets. We will never spam your Inbox.

Hope you are enjoying and learning a lot with abundance of information about:-

How to Fix 502 Bad Gateway Error.

 

How To Clear Cache On Laptop Browsers

How To Clear Cache On Laptop Browsers?

How To Clear Cache On Laptop Browsers?

Getting information and data from around the web takes processing power and time. The data needs to travel from one server to another. Using caching cuts down on this time and resource usage.

What is cache – answering this will depend on the context. In simple terms cache is a way to save and quickly recall frequently used data. Managing your cache especially when using WordPress can be the difference between a smooth, fast-running site and a frustratingly slow site.

This blog will answer the questions – how to clear cache on laptop browsers and what is cache and we will provide some insight into how to manage yours on different browsers.

How To Clear Cache On Laptop Browsers 1

What Is Cache?

How web caching works? Cache takes data processed by an app and stores it for later use. It does not have to be in the browser per se but you will find websites and their underlying technology use cache a lot.

Caching is the term for the process of storing and recalling the saved data.

Cache usually includes two elements:

  • The caching software itself runs the process and shuttles it between the various other elements.
  • Random Access Memory – RAM and In-Memory engines which stores the data passed by the caching technology.

These elements have to be high-quality and collaborative. Slow-performing RAM will not be able to recall the data quickly enough for the software to use it efficiently.

what is cache - caching

A cache is almost and always necessary for most web applications especially given how large page file sizes are. A solid implementation can give you precious seconds back in some cases.

A user who remarks that a site loads fast gives an indirect compliment to the caching software at the heart of the website’s server.

How Cache Can Help You Optimise Websites

In today’s world computer technology is constantly expanding hence memory, hard disk space and other such computer processing elements are increasing in size at a rapid rate. Those were the days when 64 KB of RAM in our personal computers was a wow factor, today there are Gigabytes – GB of RAM on tap.

Websites are also becoming heavier due to the demands of modern web development and related technologies place on-site code. It not only requires more processing power for an end-user but also a more robust server and the technology to accommodate. Without memory and caching – the loading speeds slows to a crawl.

page speed matters

That is why Search Engine Optimisation – SEO has recognised that page speed is a primary factor for ranking websites. While the exact details are not known, the ranking factors that go into the placement of a site in the Search Engine Results Pages (SERPs) include references to site speed.

While ranking metrics will not use site speed as a direct measurement as you would like to imagine it since there are too many factors in play to use it as a reliable metric in itself.

There are a lot of other aspects to take it into account. For example – the quality of your website’s HTML code and the loading times from within Google Chrome have an impact as well.

page loading speed

Regarding User Experience UX – A longstanding metric states user will abandon a page after only two seconds’ wait. It brings up a few issues:

  • Your Google Rank Brain optimisation — which includes bounce rate needs to be spot-on or else your SEO efforts are dead in the water.
  • A faster site loading speed will help keep your bounce rate in check.
  • The UX of your site is one of your website’s most critical elements.

Caching can help in all of these areas by reducing the time it takes for your page to load. What’s more – the resources your site uses will be lower and further reduce the impact.

2 seconds rule

Summary – a site that loads fast with the most relevant and up-to-date information will perform better than the rest.

How to clear caching on laptop in different browsers

How to Clear Your Cache

One of the more common needs is to know how to clear your cache. As you may expect there are a few ways to do this and it depends on your device or browser. We will take you through the various approaches – starting with your desktop browser.

Clearing Your Browser’s Cache

By far the most common relationship an end-user will have with caching is within the browser.

Clearing your browser cache is a tried and trusted way to get things working again if there are issues. It is a method often presented as much as turning something off and back on again.

Each browser will have a dedicated preferences screen to give you access to the cache to various degrees.

How to Clear Cache and Cookies In Chrome

To clear the cache and cookies in Chrome – you will need to access the browser’s Settings menu. There are three different ways you can get here.

The first way is to click the three vertical dots icon in the top-right corner of the screen – hovering over More Tools and then selecting Clear Browsing Data.

how to clear cache on google chrome

You may have noticed from the above image that there is a shortcut key you can use. To go straight to the page to clear your cache and cookies – press down simultaneously on the Ctrl + Shift + Delete keys.

Alternatively you can enter chrome://settings/clearBrowserData in the address bar.

chrome-setting-clearbrowserdata

Regardless of which method of navigation you choose – you should now be at the Clear Browsing Data window.

The first thing you need to do is select the time range for deleting the cookies and cache. Click the arrow in the box next to Time Range to expand the menu and then select the desired time range. This is set to All Time by default.

clear browsing data

Next check the boxes next to Cookies And Other Site Data and Cached Images And Files. You can also clear your browsing history here too.

Once the boxes are checked – select the Clear Data button.

clear data

After a few moments your cache and cookies will be cleared.

Why clear the cache?

You generally would not need to clear Chrome’s cache. When all is working properly Chrome manages the cache – making room as needed.

Clearing Google Chrome’s cache is a diagnostic tool you might use when things do not seem to be working properly. For example if pages are not displaying properly or it just seems excessively slow or otherwise broken – clearing the browser cache is an easy first step. It harms nothing and might fix things.

Since the cache is a speed optimisation – the only side effect of clearing it might be a temporary performance hit where pages might take just a little longer to load the first time you visit them after the cache has been cleared.

How To Clear Cache In Firefox

Open Firefox on your Mac or PC. Click the menu button in the upper right hand corner of the browser. This appears as three lines. Click Preferences which is located next to a gear symbol. 

how to clear cache in firefox

Click on the Privacy & Security tab on the left hand side. Scroll down until you see the Cookies and Site Data section. Click Clear Data. Check the box next to Cached Web Content. Click Clear – to clear your cache.

clear cached web content

How To Clear Cache In Safari

Click on the Safari tab at the top left of your screen and choose Preferences… from the dropdown menu.

how to clear cache on safari

Click the Advanced tab of the menu that pops up. At the end of the tab – select and tick the Show Develop menu in menu bar box and close the Preferences menu.

show develop menu in menu bar

Click the Develop tab from the Safari menu at the top of the page. Click Empty Caches from the dropdown menu. 

Click Empty Caches from the Develop tab

You can quickly get to the Microsoft Edge clear cache settings if you type edge://settings/clearBrowserData in the address bar.

how to clear cache on microsoft edge

Or alternatively the Microsoft clear cache menu can also be reached by clicking the ellipsis icon near the top right corner and selecting settings in the menu.

choosing ellipsis icon and settings

Microsoft Edge will now open a new tab with all of its settings. Select Privacy, search and services on the left. On the right side of the screen Edge will show all the privacy related settings.

privacy search and services

Here you may have to scroll down a bit in order to access the Clear browsing data section – where you will see a button that allows you to choose what to clear.

clear browsing data 1

Now Edge will display an overview not only of the different types of data you can clear but also the time range of the data you want to clear.

different types data to clean

Now with Microsoft Edge you can keep your browsing history and autofill information or saved passwords that Microsoft Edge has conveniently saved for you over time. If you only want to delete your most recent browsing history then that is possible too.

You can select whether you want to delete date from the last hour, the last 24 hours, last week, last month or all time.

clear time range data

Besides selecting over what period of time you want to delete browsing data, you can also choose what type of data you want to delete.

delete browsing data

How to Clear the Cache In Opera

To clear the cache in Opera – open the browser on your computer.

Click the Opera logo from the top left. This will expand a series of controls for the browser.

how to clear cache in opera

Click the Settings option from the list. A new tab will open.

click on settings

Scroll to the bottom and click on Advanced. This is where you will find the Opera cache location in settings.

scroll to bottom and click on advanced

Click the Clear browsing data option.

clear browsing data option

By default Opera will select all three options in this basic screen. This will clear the history of sites you visit, cookies and site data and all cached images and files on the computer.

Select all you want to remove and click – Clear data. You can also select the time range of files – this way you can save data for older sites while troubleshooting or clearing newer ones.

clear data 1

NOTE: You can also use the Advanced tab from this window if you want additional options. From here, you can target specific types of data you want to clear from Opera’s cache.

click advanced tab

After a few moments – the cache is deleted and you are brought back to the advanced screen. The time it takes to clear the cache in Opera on a PC depends on the number of files you have stored.

In reality it can take anything from a few seconds to several minutes for Opera to clear the cache.

It is not always bells and whistles with caching. The main concern is implementing a cache that works exceedingly well. A large and frequent caching cycle is not necessary for many small websites or non-enterprises or networks if your pages have not changed much.

On the other hand – a strategy and implementation that does not cache enough or in the right way will show outdated pages. This issue can sometimes happen with WordPress websites and there are tricks and tips to overcome it.

Consider a pandemic resource site that has to update its information regularly. Now consider how inadequate or non-existent browser caching could impact the page.

The good news is that getting caching set up to mitigate or lessen the impact of these drawbacks is straightforward.

We have already noted how caching is involved in several different ways across computing in general.

Now we are looking at non-CPU caches. If you check at the Apple MacBook specs, you will notice there are often a few megabytes -MB of caching included in the processing chip:

technologies that use caching

This caching also holds for mobile devices. Here we are looking at caching that uses servers in some capacity and below are some of the different technology we are talking about:

  • Browsers. A browser cache is the first thing you will think of when it comes to technology. It stores regular requests in the cache for faster loading on the next call.
  • Devices. While the CPUs themselves are beyond the scope of the article, the browsers and apps on the device will often use the storage and RAM to cache data.
  • Apps. Yes the apps can also have a cache to store oft-used data. Once again – this is going to use on-device storage that is not the CPU to cache data.
  • Servers. Another everyday use for caching. Some of the server data that shuttles around can be stored and recalled for faster execution and processing.
  • Domain Name Server – DNS caching. A focused application for caching. The machines involved here do nothing but cache data so the front-line servers can shuttle data while the DNS caches ensure a smooth operation.

It is worth pointing out a few points on related technology to caching. For example – you may consider that storing cookies is similar to caching web pages which may be true.

Cookies are stored on your computer after being triggered by the browser. The difference is that cookies store information about you and your usage rather than the page state.

content delivery network -CDN

A Content Delivery Network – CDN does the same thing as caching on paper. CDN stores the whole website as a set of static files rather than working with the site directly while it has the hallmarks of caching on the surface – it is a different way of storing and delivering websites that still need caching to run fast.

Some CDNs like Cloudflare take care of both aspects and more which makes client sites faster and more secure.

Despite our love and affection for WordPress it is not the fastest platform around. If you are using WordPress for your website – you will need to employ caching to help serve up a rapid experience. Your site speed is a joint effort between you, your host and your choice of caching plugin.

best wordpress caching plugin

For customers – a dedicated WordPress caching plugin will likely be an excellent addition to your setup.

There are many solutions available in the WordPress caching plugin arena and having to make a choice could be overwhelming. Let us take a look at some of our favourite options.

There are in no particular order of importance since all of them are equally important and highly recommended.

WP Super Cache

The most straightforward option is to choose WP Super Cache. The WP Super Cache plugin is considered the official WordPress caching plugin. It serves static HTML files in place of your dynamic PHP files which are what almost all of your visitors will see – all without experiencing any loss of functionality.

WP Super Cache

What’s more is that the plugin includes preloading, garbage collection -removing cached items that are no longer required, a CDN and REST API endpoints for developers. It is a solid entry point to caching plugins and could be all you need.

W3 Total Cache

W3 Total Cache has been on many users’ install lists for a long time. The W3 Total Cache plugin is billed as a Web Performance Optimisation -WPO framework and claims to be agnostic to the choice of the web host.

It is packed with features and functionality but it is notorious for being overwhelming to new users. W3 Total Cache has many features but you need the time to use it most optimally.

W3 Total Cache

There are also simple caching plugins that perform better than the leading contenders in the eyes of some users and these are – WP Fastest Cache and LiteSpeed Cache both have amazing reviews and simple dashboards.

WP Rocket

When it comes to premium plugins – WP Rocket rules the roost.

WP Rocket

The WP Rocket plugin is a high-performing plugin that is also easy to use. It applies a bunch of best practices and has over 2.2 million users. WP Rocket is also compatible with most WordPress products and services.

How to Install a Caching Plugin

The process is straightforward and is the same as any other WordPress plugin when it comes to installing a cache plugin. Caching will be enabled upon activation and there will often be a dedicated panel to handle how the plugin caches your website.

For example – you can locate WP Super Cache’s options in the Settings > WP Super Cache panel:

wp super cache settings

Your particular plugin will have different settings depending on its complexity and goals. A solution like WP Super Cache is quite deceptive since it appears simple on the surface but as the Advanced section shows – there are a lot under the hood to tinker with:

wp super cache advanced settings

Our guide is to stick to the simple – recommended options if you are unsure of what a particular setting does. Most caching plugins have quick-to-set options for different caching setups.

For example in WP Super Cache – you can choose either Simple or Expert caching:

wp super cache delivery method

The main difference is that the Expert mode uses Apache’s mod_rewrite option to serve cached files. Therefore for a user who does not know the inner workings of how files are cached – the Simple delivery method would be the acceptable choice.

The good news is that clearing a cache is often a case of clicking once and waiting for the browser to do its thing. Most browsers will let you select the data you want to clear from the cache and this will increase your click count if clicks are important for your site.

Clearing a DNS Cache

For the unaware – the DNS cache stores all of the most recent attempts to connect to the internet specifically its domain names. In simple terms – it is a list of DNS lookups the computer uses to figure out how to connect to the internet.

It is different from other caches on your device but could have some cross-over. Before you get into clearing the DNS cache – you should have three things in place:

  • Admin access to your computer or device.
  • Access to the Terminal, Command Prompt or Command Line.
  • Skills necessary to use the Command Line Interface –CLI although you do not necessarily need to know the exact commands to use.

Of course when it comes to the last point – at Best-Digital Marketing Services we are here to help.

best-digital marketing services

Clearing the WordPress Cache

When it comes to WordPress there are a few places you can head to clear the cache. The platform itself does not hold a cache but there are two touchpoints to consider:

  • Your hosting provider’s options which sometimes can be found within WordPress.
  • Your dedicated caching plugin.

Depending on your choice of host you will have an option within your control panel within a plugin installed within WordPress which is dedicated to your host’s server-side caching or both.

In some cases you will have a dedicated third-party plugin in place to help cache your site and you may find the option to clear it within the relevant settings or preferences screen.

How you access this will depend on the plugin of your choice. For example, WP Super Cache displays the option both on the toolbar and the Settings > WP Super Cache page:

wp super cache delete cache button on wordpress

For W3 Total Cache – you will again find the options you need in the toolbar at the top of WordPress:

w3 total cache purge cache button on wordpress

For most plugins the option to clear the cache will be within the toolbar or labelled. As for your host – you will find the option to clear the cache in two places

  • the WordPress dashboard if there is a plugin involved and
  • your hosting control panel.

Some hosts help WordPress users by adding specific options to the WordPress admin through a plugin. In most cases these act in a similar way to third-party caching plugins.

However the best approach will be to head to your hosting control panel and look for your caching options.

Conclusion

How To Clear Cache On Laptop Browsers and meet your goals

Websites need to run fast. The most efficient way to do this is through caching. It is a way to store the data that is often pulled and pushed between servers. Once saved browsers can recall it in a split second making your website load quicker and keep you on the right side of SEO.

An efficient and effective host will have server-side caching in place and do all it can to make sure your site use it to its most optimum. A good plugin will make your site run even faster and make sure caching helps every aspect of your site.

For the end-user caching is a simple technology. For those who dig deeper it is something worth spending plenty of time on since your performance relies on it.

Save time, costs and maximise your website performance with:

  • Instant help from our WordPress hosting experts – 24/7.
  • Global audience reach with data centres worldwide.
  • Optimisation with our built-in Application Performance Monitoring.

All of this and much more, in one plan with no long-term contracts, assisted migrations and a 30-day-money-back-guarantee. Check out our plans or talk to us today to find the plan that is right for you.

Further Reading: Benefits of SEO

For more information about our services and how we can help you with your Web Hosting needs:-

Join Our Blog Email List

I might send you 1 or 2 emails a month. Most probably less. Lots of tricks, tips, humour hacks, guides and exclusive ramblings in there for your good mental health and education.

limited time offer - time sensitive
education

You can unsubscribe anytime whenever you like. No risk or regrets. We will never spam your Inbox.

Hope you are enjoying and learning a lot with abundance of information about:-

How To Clear Cache On Laptop Browser?

 

How to Fix Http 404 Error - Not Found on WordPress Website

How to Fix Http 404 Error – Not Found on WordPress Site

How to Fix Error 404 - Not Found on WordPress Website

There are many potential errors you might see on your WordPress website and Error 404 Not Found is one of the common ones.

But that does not mean it is not frustrating when you or your visitors try to browse your site and keep running into the Error 404 Not Found message.

That is the last thing you want for first time potential customers to see of your brand.

How to Fix Http 404 Error - Not Found on WordPress Site

A 404 error can also be an indicator to you that something has changed or moved and a 301 redirect probably needs to be added for SEO purposes.

In this post we are going to help you get your site working again by explaining a few things:

What is the Error 404 Not Found?

Whenever you or any of your visitors go to your website, your browser sends a request to the web server and receives back data including something called an HTTP header. The HTTP header includes HTTP status codes to explain what happened with the request.

Most of the time the request works perfectly and you will never actually see the HTTP status code but if something goes wrong then your web browser will usually display a message with the HTTP status code to indicate the exact problem.

Just like other error messages -500 error, 502 error, 504 error, etc the Error 404 Not Found message is the result of that process.

What Does Error 404 Not Found Actually Mean?

Basically it means that the client – your visitor’s or web browser was able to successfully connect to the host – your website’s server but it was unable to find the actual resource that was requested like a specific URL or filename.

For instance If you try accessing a specific URL like a domain.com/what-is-WordPress and if no content carries that name then you will get a 404 error message.

What Does Error 404 Not Found Actually Mean

This error has absolutely nothing to do with your server -it just means the requested file such as image, page, JavaScript, CSS or post is missing.

When a 404 error message pops up it simply means the server cannot find the file the user requests.

What Causes Error 404 Not Found on WordPress?

Some of the common causes of 404 errors are as follows:

  • A mistyped URL.
  • Caching problems.
  • An issue with your Domain Name System (DNS) settings.
  • WordPress compatibility issues.

If you get this error on the entire sites content then it is typically due to an issue with your WordPress site’s permalinks.

However if you only see it on certain individual pieces of content then it is most likely because you changed a piece of content’s slug without setting up a redirect.

This means that the content accessible at the Web address URL you have just accessed does not exist or no longer exists.

what causes http 404 error

The difference between the two can often help a user find the right URL if they use common sense.

As a webmaster you need to correct the link as soon as possible because it may risk losing a very large majority of visitors and sales – who are not going to bother doing if they cannot access your product page or blog article or other by any other means.

The consequences can be devastating for both the traffic on the site and for the turnover of an online store therefore you must be vigilant and watch this closely to correct any 404 errors as soon as it occurs.

To monitor this Google Search Console will be ideal and saves time in corrective actions. We strongly recommend you to use 404 broken link finder tools mentioned below in this article.

Error 404 Not Found Variations

Because each web browser displays error messages differently – you might see a different message for this error.

Other common variations include:

  • Error 404
  • 404 Not Found
  • HTTP Error 404
  • 404 – file or directory not found.
  • ERROR 404. PAGE NOT FOUND On WordPress site
  • The requested URL was not found on this server.
  • The page cannot be found
  • We can’t find the page you are looking for.
  •  The requested URL was not found on this server
google 404 not found page

The Error 404 Not Found message is also unique in that many sites will actually create a custom page to address the error rather showing one of the messages above.

Some WordPress themes also include custom 404 pages by default. For that reason you might not actually see the error message at all because many sites will use funny or creative 404 pages instead.

custom error 404 not found page

If you create a 404 Error Page – try to include a search box and some of your recent blog posts to help visitors find what they might be looking for. Always include search functionality on your 404 page.

Error 404 Not Found Impact on SEO

Error 404 Not Found does not have any inherent negative impact on SEO. But it might have a negative impact depending on the reason for why the error is happening.

For example -if a visitor just mistypes a URL and sees a 404 error then there would not be a negative impact on SEO.

no negative impact on seo

But if you have individual errors because of broken URLs then that will inhibit Google’s ability to properly crawl your site and this can have a negative SEO effect in that way.

Additionally if a permalink issue is causing site wide 404 errors then Google would not be able to crawl any of your site’s content. In other words always fix your 404 errors as soon as possible.

Error 404 Not Found Impact on Site Performance

Many sites do not realise that generating a lot of 404 errors can easily run into performance issues since these responses are not cached especially on larger sites.

To minimise the impact of 404 requests on site performance you need to automatically cache 404 pages for 15 minutes.

If you create a new page with the same URL as the cached 404 page then you need to automatically purge the cache so your visitors will be able to see the new page immediately.

minimise error 404 impact on site performance

This means your site will be protected from Hypertext Preprocessor – PHP and CPU spikes caused by traffic to dynamic 404 pages.

You are probably generating more 404 errors than you think and using the appropriate tools can help you determine the exact amount.

For example – a certain site is missing some mobile icons such as /apple-touch-icon.png.

These are most likely in a theme or plugin’s code that is getting queried but the actual icons were never added therefore the server generates a 404 error as it cannot find the resources.

WordPress is a flexible platform – no doubt but its flexibility can be a double-edged sword. Sometimes doing too much can overtake some settings and the whole hell breaks loose, random errors start appearing and your site goes down.

Luckily because WordPress has so many users therefore finding help is not difficult. 

How to Fix Error 404 Page Not Found in WordPress?

We will cover a couple different methods for how to fix the Error 404 Not Found message depending on whether it is happening site wide or to specific content.

Because this error discloses inconsistency with a link therefore it can resolve the same by properly configuring and saving WordPress permalinks.

You should also correct the linking structure using a .htaccess file.

how to fix error 404 page not found

1. Update Your Permalinks

It is a simple solution to fix 404 error in WordPress by saving WordPress permalinks. This will update .htaccess file with the correct configurations for WordPress website.

The easiest way to fix this is to update your permalink settings through the WordPress dashboard via WP-login or WP-admin.

wordpress wp admin

All you need to do is go to Settings → Permalinks. 

permalinks settings

Then scroll down and click on Save Changes. You do not need to make any changes – clicking Save Changes is enough.

save settings

Now try accessing the posts to see if the 404 error is fixed.

If saving the permalinks did not solve the 404 issues then you can manually reset permalinks by editing the .htaccess file.

To do this you need to access WordPress files using FTP or cpanel. When connected via FTP locate .htaccess file and edit it.

manually reset permalinks ia htaccess files

Add in one of the following codes, save and upload the updated file to your server:

If site is on the main domain – e.g. www.yoursite.com then add this code to .htaccess file:

adding code

Or copy and paste below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

After editing and uploading a new file, refresh your site and access posts/pages to see if this fixes the 404 issues.

B. If WordPress Site in a Subdomain

If your site is installed in a subdomain like a blog.yoursite.com then use this code instead.

if wordpress is in a sundomain

Or copy and paste below:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

C. When WordPress in subdirectory

If your site is on a subdirectory like as – www.yoursite.com/blog then edit .htaccess to include this code instead.

when wordpress is in subdirectory

Or copy and paste below:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

3. Set Up 301 Redirects for Moved or Renamed Content

The 301 redirect is the most effective solution for correcting 404 errors on your site.

However it must be done correctly to redirect to the right pages as appropriate:

  • The page with error 404 has been replaced on the site by a new page which has a different URL: We are redirecting directly to this new page.
  • The page with error 404 has not been replaced on the site: We are redirecting to a page with similar content. If no similar content exists then it is also possible to redirect to the category page of the old content. As a last resort- redirect to the home page but do not do this systematically.
  • Before deleting a page and redirecting always ensure to check if it has backlinks or external links, visits and if it is still well-positioned in Google.
set up 301 redirects for moved - renamed contents

To begin -you can use a free Redirection plugin to fix redirects from your WordPress dashboard. After installing and configuring the plugin visit the Tools menu and select Redirection and then type the 404 page URL in the Source URL box and the new working URL in the Target URL box.

how to start redirection in wordpress

Manually in the .htaccess of your hosting panel via cpanel – using the piece of code:

  • To 301 Redirect a Page:

RedirectPermanent /old-file.html http:// www.domain.com/new-file.html

  • To 301 Redirect an Entire Domain:

RedirectPermanent / http:// www.new-domain.com/

Once you have inserted the commands to 301 redirect your pages you need to ensure that there is a blank line at the end of the file.

Your server will read the .htaccess file line by line which means you need to throw an end line character to signify that you are finished.

An easy way to do this is to put a blank line at the bottom of the file.

Now that you have cleaned up your 404 errors – you can now anticipate this type of problem by creating a well-designed custom 404 page.

You can get inspiration from Google which offers different original creations than others.

Edit .htaccess

You need to edit the .htaccess file and add a snippet of code at the top which can be done in a number of ways. You can either get it done through an FTP program’s edit mode or edit the file on your PC and then upload it to the server via FTP or you can do this via cPanel >> File Manager.

This is the code:

manual 301 redirection via htaccess files

Or copy and paste below:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./index.php [L]

# END WordPress

While you can do your best to prevent 404 errors by using the tips above it is impossible to entirely eliminate 404 errors because some things are just plain outside your control. It is not uncommon for small WordPress sites to have thousands of 404 errors every month.

For example – if a visitor mistypes the URL or if another website links to a page that does not exist then people are going to get 404 errors no matter what.

To provide a more user-friendly error page you can use one of the many 404 page plugins.

create your own error 404 page not found

For example the free 404 page plugin lets you set up a custom 404 error page with:

  • A search box
  • Important links
  • Contact information

Another important feature of the 404page plugin is that it does not create redirects. A 404 page should never be redirected to a physical page such as yoursite.com/404.

The 404 error should always be generated dynamically on the page in question.

By including these elements you are providing your visitors the tools they need to find their way to the right page.

Always remember – keep your 404 page light for better performance and only include what is absolutely needed.

How to Monitor 404 Errors Going Forward

Going forward it would be beneficial to pay attention to which requests are causing 404 errors at your site.

This can help you:

  • Find broken links that are sending people to a non-existent resource which could be internal links or external links. You want to do your best to fix those links if it is all possible.
  • See which pages Google is having trouble crawling. You want to figure out why Google is trying to crawl a non-existent page and set up a redirect if needed.
  • Troubleshoot issues and improve performance with regards to 404 errors.
how to monitor 404 error going forward

Use Google Analytics Tools

For example – you could trigger the following event on load of the error page:

ga(‘send’, ‘event’, ‘error’, ‘404’, location.pathname);

With the help of Google Analytics, you can set up a custom report to track 404 errors from external links.