How to Fix the ERR_CONNECTION_REFUSED Error in Chrome

Are you seeing the ERR_CONNECTION_REFUSED error when trying to access a website or when viewing a website resource using your browser’s inspect tool?

This error message appears when your browser is unable to connect to the website you’ve requested. You might also see it in your browser’s inspect tool when you are exploring why a certain resource on the website won’t load.

In this article, we’ll show you how to fix the ERR_CONNECTION_REFUSED error in Chrome.

How to Fix the ERR_CONNECTION_REFUSED Error in Chrome

What Is the ‘ERR_CONNECTION_REFUSED’ Error in Chrome?

The ERR_CONNECTION_REFUSED message is displayed in Google Chrome when it is trying to open a web page or website resource but is unable to do so. This error code is usually included inside an error message such as:

  • ‘This site can’t be reached’
  • ‘Failed to load resource’

There are lots of common WordPress errors, but this error may stop you from visiting your own website and logging in to the WordPress admin area. You’ll typically want to solve this problem as quickly as possible.

Often when you see this error message, your WordPress website is still working, but something is stopping the browser from accessing it. In many cases, you will only need to fix a problem with your own browser or internet connection.

With that being said, let’s take a look at how to fix the ERR_CONNECTION_REFUSED error in Chrome. First, we’ll look at how to fix the error when you can’t access an entire website, then we’ll show the solution for when you can’t access a specific file or resource on a website.

How to Fix the ‘This Site Can’t Be Reached’ Error

Usually, this message is displayed when you can’t access an entire website.

You will see the Chrome error message ‘This site can’t be reached’ along with the ERR_CONNECTION_REFUSED error code. The message may even suggest a few things to try to fix the error, such as checking the connection, proxy, firewall, and DNS configuration.

This Site Can't Be Reached Error

Other browsers will display similar messages, such as:

  • ‘Unable to connect’
  • ‘Hmmm…can’t reach this page’

There are many things that can interfere with your connection to the website, and you will need to follow some troubleshooting steps to identify and fix the problem.

We’ll briefly cover the steps you should take below. For detailed instructions, see our guide on how to easily fix the ‘This site can’t be reached’ error in WordPress.

Check Your Internet Connection

The simplest fix is to check that you’re connected to the internet and restart your modem and router. Resetting your internet connection may be all it takes to reconnect to your website.

If not, you should check to see whether your website is working. Simply visit the Website Uptime Status Checker website, then enter the URL of your own site.

IsItWP Uptime Checker Tool

If your site is down, then you should contact your WordPress hosting provider to let them know your website is down.

Clear Your Browser Cache

Your web browser stores files and data from the websites you visit, so it doesn’t have to download them again. However, this can cause problems if the cached files become outdated or corrupt.

You can easily clear the browser cache in Google Chrome by clicking on the three-dotted icon in the upper-right corner and then selecting ‘More Tools,’ followed by ‘Clear Browsing Data…’

How to clear the browser cache in Google Chrome

In the popup that appears, check the box next to ‘Cached images and files’ and then click the ‘Clear data’ button.

Now try revisiting the website to check whether you can access it.

Troubleshoot the Software on Your Computer

Some of the security and networking software you run on your computer may be interfering with your connection to the website. This can include your firewall, antivirus software, VPN, and proxy server.

We offer detailed instructions on how to troubleshoot each of these in our guide on how to fix the ‘This site can’t be reached’ error.

Troubleshoot Your DNS Settings

Similar to the browser cache, your computer stores the IP addresses of all the websites you visit. This means the browser doesn’t have to look up the same IP address multiple times.

By flushing your DNS cache, you’ll get the very latest information about a website, including its new domain name or address.

To help you out, we’ve created a complete guide on how to clear your DNS cache for Mac, Windows, and Google Chrome.

If you still can’t access the website after doing this, then you can try changing your DNS server as well. You can follow the detailed instructions in the change the DNS server step of our guide on how to fix the ‘This site can’t be reached’ error.

Add the Addresses for Google's DNS Servers

Reset the TCP/IP Settings

Finally, if there’s a problem with how your internet connection is configured, then renewing your TCP and IP protocol will return the connection to its default settings, which may solve the problem.

You can learn how to do this step-by-step in the reset the TCP/IP settings section of our guide on how to fix the ‘This site can’t be reached’ error.

Click the 'Renew DHCP Lease' Button

How To Fix the ‘Failed To Load Resource’ Error

You might notice that, while your website loads, a certain resource or file doesn’t. This file could be an image or other media file, JavaScript, or a CSS stylesheet. A missing resource can cause your website to misbehave or not function properly.

When that happens, the browser will add a notice in the error console for debugging purposes.

In most cases, you would see this error in your browser’s error console when using the Inspect tool. You might see the error message Failed to load resource: net::ERR_CONNECTION_REFUSED.

Refused to Load Resource Error

This error message happens when your website’s code mentions the file, but your browser is unable to download it. This can happen when there is a problem with the file itself, or the URL that points to it.

To fix the problem, you will need to either replace the resource in question or fix the URL. We offer detailed instructions for both of these in our guide on how to fix the ‘Failed to load resource’ error in WordPress.

We hope this tutorial helped you learn how to fix the ERR_CONNECTION_REFUSED error in Chrome. You may also want to see our ultimate WordPress security guide, or check out our list of easy ways to increase your blog traffic.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix the ERR_CONNECTION_REFUSED Error in Chrome first appeared on WPBeginner.

How to Fix The Invalid JSON Error in WordPress (Beginner’s Guide)

Are you trying to fix the invalid JSON error in WordPress?

This error appears when editing WordPress posts or pages on your website. You’ll see a message saying ‘The response is not a valid JSON response’ and updating that page would fail.

In this article, we’ll show you how to easily fix the invalid JSON error in WordPress. We’ll also talk about why this error occurs and how to avoid it in the future.

JSON response is not valid error in WordPress

What causes ‘Not a Valid JSON Response’ Error in WordPress?

Failure to receive an expected response from the server causes the ‘Not a valid JSON response’ error in WordPress.

Basically, WordPress needs to communicate with the server while you are editing a blog post. It relies on getting responses from the web hosting server in the background. This response is usually in JSON format which is used to quickly transport data using JavaScript.

If for some reason, WordPress fails to get the response, or the response is not in JSON format, then you’ll see the ‘Not a valid JSON response’ error.

Not valid JSON response error displayed in WordPress

This error could appear for a number of reasons. However, the most likely cause of it to occur is incorrect URL settings in WordPress or broken permalinks.

That being said, let’s take a look at how to easily fix the invalid JSON error in WordPress.

Important: Please make a complete WordPress backup before making any big changes to your website. This allows you to easily restore your website to the previous state.

1. Check WordPress URLs in Settings

First, you need to make sure that your WordPress Address and Site Address settings are correct.

Simply, go to Settings » General page. From here, you need to review the WordPress Address (URL) and Site Address (URL) fields.

WordPress URL settings

For most websites, this setting needs to have the same URL in both fields.

However, rarely, some users may have given WordPress its own directory and serve the website on a different address. In that case, they can have different URLs here.

However, if your Site Address is incorrect then that would trigger the invalid JSON error in WordPress.

If you made any changes to the settings, then don’t forget to click on the Save Changes button to store your settings. You can now edit a blog post and see if adding any new blocks or saving that post triggers the ‘Not valid JSON response’ error.

If you are still seeing the error, then continue reading.

2. Fix WordPress Permalink Structure

WordPress comes with SEO friendly URL structure that allows you to use human-readable URLs for your posts and pages.

However, sometimes a user may mess up the permalinks settings. This would make it impossible for the WordPress editor to get a valid JSON response and cause the error to show up.

To fix this, you need to simply visit Settings » Permalinks page. From here, you need to carefully review the permalink options.

Fix permalinks in WordPress

If you are unsure whether you are using the right settings, then simply select one of the default formats available.

After that, go ahead and click on the Save Changes button to store your settings.

You can now try editing a blog post or page to see if the error has disappeared. If it hasn’t, then you can try this next step.

3. Regenerate WordPress .htaccess File

The .htaccess file in WordPress is used as a configuration file to manage SEO-friendly URLs (permalinks).

Normally, WordPress can automatically regenerate and update it. You can also trigger that update by simply clicking on the Save Changes button at the bottom of Settings » Permalinks page.

However, sometimes it may not get updated or has incorrect settings. This would affect your WordPress permalinks and may also cause an invalid JSON response error.

To fix this, you need to connect to your website using an FTP client or the file manager app in your WordPress hosting account dashboard.

Once connected, you need to locate the .htaccess file in the root folder of your website and download it as a backup to your computer.

Download .htaccess file as a backup

Tip: Can’t locate .htaccess file? See this quick article on how to find .htaccess file.

After that, you need to edit the .htaccess file using FTP client or the file manager app.

Edit .htaccess file

Once the file opens, you need to delete all the code inside it and replace it with the following code:

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Don’t forget to save your changes and upload the file back to your website.

You can now visit your website and edit and post or page to see if you can reproduce the invalid JSON response error.

If you are still seeing the error, then there are a few more steps you can take.

4. View The Rest API Debug Log

The invalid JSON response error would also mean that WordPress REST API on your website encountered an error.

The REST API is the set of techniques WordPress uses to communicate with the server as you work on your website.

You can see details of this error in the WordPress Site Health tool. Visit the Tools » Site Health page.

REST API issue in WordPress

From here, you may see an issue labeled ‘The REST API encountered an unexpected result’.

Clicking on it will show you more details which may give you some clues about which plugin or third-party service may be causing the issue.

If this doesn’t provide any clue, then you can move on to the next step.

5. Deactivate All WordPress Plugins

Occasionally, WordPress plugins may conflict with each other or the WordPress core. This could result in unexpected behavior and could be a potential reason for the invalid JSON error.

Simply go to the Plugins » Installed Plugins page. From here, select all your WordPress plugins and then choose ‘Deactivate’ under the Bulk Actions drop down menu. Now, click the Apply button to continue.

Deactivate all plugins

WordPress will now deactivate all your installed plugins.

You can now try again to reproduce the error. If the error disappears, then this means one of the plugins installed on your website was causing it.

To figure out which plugin, you need to activate them one by one and then try to reproduce the error. Repeat this until you find the culprit.

After that, you can reach out to the plugin author for support or find an alternative plugin.

6. Temporarily Switch to the Classic Editor

If all the above steps fail, then you can temporarily switch to the Classic Editor for WordPress.

This older version of WordPress editor uses a simpler text editor and doesn’t rely heavily on REST API to get JSON response.

To use it, you need to install and activate the Classic Editor plugin. For more details, see our step by step guide on how to install a WordPress plugin.

The plugin works out of the box, and it will disable the Gutenberg editor upon activation.

You can now continue working on your website and get back to the troubleshooting later.

7. Further Troubleshooting

A number of things can block WordPress REST API or make it return an invalid JSON response. We have addressed the most likely culprits above, but if that didn’t fix it for you then here are some more steps that you can try.

Switching to a Default WordPress Theme

Sometimes a conflict between your WordPress theme and a plugin or the WordPress core may result in unexpected behavior.

You can test this, by simply switching to a default WordPress theme like TwentyTwentyOne or Twenty-Twenty.

Temporarily Turn off Website Application Firewall

If you are using a WordPress firewall like Sucuri, Cloudflare, or a plugin, then it is possible that they may sometimes block legitimate requests too.

The easiest way to figure this out is by temporarily disabling your WordPress firewall plugin or service.

Some application-level WordPress firewalls can be disabled by simply deactivating the plugin. For DNS level firewalls like Sucuri and Cloudflare, you can disable them from your account dashboard.

Turn on Debugging in WordPress

WordPress comes with a built-in feature that allows you to keep a log of errors. However, it is not enabled by default.

To turn it on, you need to add the following code to your wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

After that, WordPress will keep a log of all errors in a debug.log file located inside /wp-content/ folder. You can access this file by using an FTP client.

The error log may provide you a clue about what may be causing the invalid JSON error on your website. For more details, see our guide on setting up WordPress error logs and using them for debugging errors.

Seek Expert Help

Finally, if all else fails, then this could be due to a misconfiguration on your WordPress hosting server. Most reliable WordPress hosting companies are able to help users with common WordPress issues like that.

Simply reach out to them via live chat or support ticket and they may be able to help you fix it.

We hope this article helped you learn how to fix the invalid JSON error in WordPress. Let us know which solution worked for you in the comments below.

You may also want to see our complete handbook of the most common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix The Invalid JSON Error in WordPress (Beginner’s Guide) appeared first on WPBeginner.

How to Fix Error Too Many Redirects Issue in WordPress

Are you trying to fix the ‘Error Too Many Redirects’ issue on your WordPress website?

It is a common WordPress error that may be caused by a plugin or incorrect settings. However, it leaves users locked out of their WordPress websites which makes it particularly troublesome.

In this article, we’ll show you how to easily fix the ‘Error too many redirects’ issue in WordPress. We will also cover how to regain access to your website and troubleshoot the error.

Fixing too many redirects error in WordPress

What Causes The Error Too Many Redirects Issue in WordPress?

The ‘Error too many redirects’ is caused by a misconfigured redirection issue in WordPress.

As you know that WordPress uses an SEO-friendly URL structure feature that uses the redirect function.

Similarly, many popular WordPress plugins use this feature to set up temporary redirects, permanent 301 redirects, and for fixing the 404 errors.

If you are using a plugin to fix the SSL insecure content issue or a WordPress caching plugin, then they may also affect redirects and cause this error.

Error Too Many Redirects in Google Chrome

However, this error doesn’t tell you what’s causing the conflict and forcing the redirect loop in WordPress.

This is how the error looks in Firefox with the message ‘The page isn’t redirecting properly’.

Too many redirects error in Firefox

That being said, let’s take a look at how to fix the error too many redirects issue in WordPress.

We will walk you through step-by-step troubleshooting, getting access to your WordPress site, and fixing the error from reoccurring.

1. Clear Browser Cookies and Cache

A common cause of the error could be your web browser cookies. Try accessing your website using a different web browser like Firefox, Safari, Opera, Microsoft Edge, etc.

If you are able to access your website normally using a different browser, then you need to clear browser cookies and cache on your regular browser.

Clear cookies and cache in Google chrome

We have a detailed guide on how to clear browser cache in all major browsers that will help you do that.

On the other hand, if changing the browser doesn’t fix the issue then you can move on to the next step.

2. Deactivate All WordPress Plugins

The most common cause of the WordPress redirect loops or ‘Too many redirects’ issue is a plugin conflict. A plugin trying to set up a redirect in a way that conflicts with default WordPress redirects would end up causing this error.

To fix this, you need to deactivate all WordPress plugins on your website. Now, normally you can just go to Plugins » All Plugins page inside the WordPress admin area and deactivate plugins from there.

Deactivate all plugins

However, we are assuming that due to the redirect error you may not be able to access the WordPress admin area.

In that case, you will need to deactivate WordPress plugins using an FTP client, or the File Manager app in your WordPress hosting control panel.

Simply connect to your website using an FTP client and go to the /wp-content/ folder.

Renaming the plugins folder using FTP

There you’ll find the plugins folder, which you need to rename to ‘plugins.deactivate’ which will deactivate WordPress plugins.

Renamed plugins folder

Basically, WordPress looks for a folder called plugins to load the plugin files. When it does not find the folder, it automatically disables the active plugins in the database.

Now you can try visiting your WordPress website. If you are able to login to your WordPress admin area now, then this means one of the plugins was causing the error.

To figure out which plugin was the culprit, you need to switch back to the FTP client or File Manager app and rename your plugins.deactivate folder back to ‘plugins’.

After that, switch to the WordPress admin area of your website and go to the Plugins » All Plugins page. From here, you can activate your plugins one by one, and then visit your website to see if you can reproduce the error.

Once you find the plugin that is causing the error, you can find an alternative to that plugin or report the issue to the plugin’s support forum.

3. Fix WordPress URLs

Another major cause of this error is a misconfiguration in WordPress URL settings. Normally, you can view these options under Settings » General page.

WordPress URL settings

For most websites, the URLs in the WordPress Address and Site Address field have to be the same. However, some users may end up using www in one URL and non-www URL in the other.

Since you may not have access to the WordPress admin area, you may need to fix the WordPress URLs using an FTP client or the File Manager app.

Simply connect to your WordPress site using an FTP client and go to /wp-content/themes/your-theme-folder/.

Edit functions.php file

From here you need to locate the functions.php file and edit it using a plain text editor like Notepad or TextEdit.

Next, you need to add the following code at the bottom:

update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );

Don’t forget to replace https://example.com with your own site URLs. You can now save your changes and upload the file back to your website.

After that, you can try visiting your website to see if this resolves the error.

For more methods, see our tutorial on how to easily change WordPress URLs.

4. Reset WordPress .htaccess File

The .htaccess file is a special file that is used by website server to manage redirects and other server settings. WordPress also uses this file for SEO friendly URLs and other redirects.

Sometimes WordPress plugins may make changes to your website’s .htaccess file which may trigger this error. It is also possible that dectivating a plugin will not remove those changes form your .htaccess file.

In that case, you’ll need to manually reset your WordPress .htaccess file.

Again, you will need to access your website using an FTP client or the File Manager app in your hosting dashboard. Once connected, you’ll see the .htaccess file in the root folder of your website.

Editing .htaccess file via FTP

Note: If you cannot find your .htaccess file, then see our guide on how to find .htaccess file in WordPress.

First, you need to download a copy of your .htaccess file to your computer as a backup.

After that, you can go ahead and delete the file from your website. You can now try visiting your WordPress blog, and if everything works normal, then this means your .htaccess file was causing the redirect error.

Now, since we deleted the .htaccess file you need to recreate it. Normally, your WordPress website can do it on its own but to make sure you can go to Settings » Permalinks page and click on the ‘Save changes’ button at the bottom.

Refresh permalinks to create .htaccess file

5. Preventing Error Too Many Redirects in WordPress

Hopefully, the above mentioned steps would have fixed the redirect issue on your website. If they did not fix the issue, then you may need to talk to your WordPress hosting company to make sure that it is not due to a server issue.

Once they fix the issue on your site, you should also figure out what caused the issue.

If it was a plugin, then you need to report the issue to plugin’s support forum. See our guide on how to ask for WordPress support. However, if you are unable to get help then you can always find an alternative plugin that does the same thing.

If the error was caused by a WordPress site misconfiguration, then you can make a note of it and ensure that your site settings are properly set up.

For more tips, see our detailed tutorial on how to troubleshoot WordPress issues on your own like a total WordPress pro.

We hope this article helped you resolve the error too many redirects issue on your website. You may also want to bookmark our ultimate handbook of common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix Error Too Many Redirects Issue in WordPress appeared first on WPBeginner.