Black Friday 40% off the first year of every plugin. Use code BLACKFRIDAY40

Skip to content

How to Fix The 400 Bad Request Error on WordPress: Step by Step

Flat browser window with warning triangle icon beside the title How to Fix the 400 Bad Request Error

You can fix the 400 bad request error on WordPress yourself in most cases, usually in under ten minutes, without touching a single line of code.

The mistake most guides make is jumping straight to fixes. The smarter first move is figuring out where the error happens, since that one detail points you to the right fix immediately.

This guide walks you through that diagnosis first and then gives you 8 fixes. They come in the order that solves the problem fastest for most sites.

We checked each fix in October 2026 against the WordPress 7.1 core code, the WordPress .htaccess docs and the Nginx docs. Each step is short enough to follow along as you go.

What Is the 400 Bad Request Error?

MDN reference page heading for the 400 Bad Request status code highlighted
Source: MDN Web Docs (October 2026)

A 400 Bad Request error is an HTTP status code. It means your browser sent a request to the server, but the server could not read or understand it. It rejected the request before doing anything with it.

If the server answers with 406 instead, a firewall rule is usually the cause. Follow the steps to fix the 406 Not Acceptable error.

That is different from a 404 error. A 404 means the page you asked for does not exist. A 400 means the request itself was broken in some way, whether that’s a bad URL, an oversized cookie, or a corrupted file on your own site.

A request whose body uses a type the server refuses returns a 415 Unsupported Media Type error instead of a 400.

You might see this error as a blank white page, a plain “400 Bad Request” message from your browser, or a styled error page from your hosting provider. MDN’s HTTP status reference covers the technical definition if you want the full spec.

What Causes the 400 Bad Request Error on WordPress?

Here are the most common causes behind this error, roughly in order of how often they show up:

  • Corrupted browser cache or cookies: The most common cause; outdated or oversized cookies confuse the server.
  • A broken or bad URL: Typos or incorrectly formed query strings trip this error almost every time.
  • A corrupted .htaccess file: Controls permalinks and redirects; one bad line can break the whole site.
  • A plugin or theme conflict: A recently updated or poorly coded plugin can send incorrectly formed requests.
  • Incorrect file permissions: A server that can’t read a needed file may return a 400 instead.
  • Oversized uploads: Files larger than your server’s limit can trigger this error too.
  • An expired login session or security token: An expired security token can make a background request fail.
  • DNS cache issues: Outdated local DNS data occasionally causes this especially after a migration.

Find Where the Error Happens First

This step takes thirty seconds and saves you from randomly changing settings that were never the problem. Answer one question first. Does the error happen on one page, only inside wp-admin or on every page?

If it’s one page only, the cause is almost always a bad URL or a broken link. If it happens only when you’re logged into wp-admin, suspect cookies, a plugin, or an expired session. If it happens on every page for every visitor, the .htaccess file or a server-level issue is the more likely cause.

Write that answer down. It tells you which fix below to try first instead of working through all eight in order.

How to Fix the 400 Bad Request Error on WordPress

Work through these fixes in order. Most people are done after step 1 or step 4. Stop as soon as the error is gone.

1. Clear Your Browser Cache and Cookies

Clear Your Browser Cache and Cookies

This alone resolves the 400 bad request error on WordPress more often than any other fix on this list. Corrupted cookies are the single most common cause.

Go to your browser settings and look for Privacy or Clear Browsing Data. Select Cookies and other site data and Cached images and files, set the time range to All Time, and clear the data. Restart your browser and reload your WordPress site to check if the error is gone.

2. Check Your URL and Query String

WordPress page not found screen shown for a mistyped URL

A single stray character in the address bar can trigger this error. Look for extra spaces, stray % symbols, or duplicate “?” characters in the URL. Then remove anything after the ? and reload the shortened version. If that loads fine, the query string was the problem and not the page itself.

3. Test in a Private Window or a Different Browser

Test in a Private Window or a Different Browser

Open a new private or incognito window and load the same page or wp-admin URL that was failing.

  • If it loads fine now, the issue is browser-side. Go back and disable your extensions one at a time to find the cause.
  • If it still fails in private mode, the problem is on the WordPress side. Move on to the next fixes.

This step tells you whether the problem lives in your browser or on your actual WordPress site.

WordPress rebuilds the rules that connect URLs to your content whenever you resave this setting. It’s a low-risk fix that solves a surprising number of 400 errors.

  1. Log into your WordPress dashboard and go to Settings > Permalinks.
    Permalinks link under Settings in the WordPress admin menu
  2. Leave the permalink structure exactly as it is. Switching it would change every URL on your site.
    Permalink structure options in WordPress with Post name selected
  3. Click the Save Changes button at the bottom and reload the page.
    Save Changes button at the bottom of the WordPress Permalink Settings screen

5. Regenerate the .htaccess File

If resaving permalinks didn’t help, the .htaccess file itself may be corrupted. This file lives in your site’s root folder and controls WordPress permalinks.

  1. Connect to your site using an FTP client or your host’s File Manager.
    WordPress root folder opened in a file manager
  2. Navigate to your WordPress root directory (the folder that holds the .htaccess file).
    The .htaccess file in the WordPress root folder
  3. Right-click it and rename it to .htaccessold. This keeps a copy in case something goes wrong.
    The .htaccess file renamed to .htaccessold
  4. Go back to Settings > Permalinks in your WordPress dashboard and click Save Changes again.
    Product permalinks options and Save Changes button in WordPress Permalink Settings
  5. WordPress generates a fresh .htaccess file on its own.
    Old and new .htaccess files side by side

If WordPress doesn’t recreate the file, create a new .htaccess file by hand. Paste in the default block that WordPress itself writes, also shown in the WordPress .htaccess docs:

# BEGIN WordPress
<IfModule mod_rewrite.c>
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]
</IfModule>
# END WordPress

If WordPress lives in a subfolder, change both / paths to that folder, such as /blog/. Nginx servers do not use this file at all.

6. Deactivate Plugins and Switch to a Default Theme

A plugin or theme update is a common trigger, especially if the error started right after you installed or updated one.

  1. In your WordPress dashboard, go to Plugins > Installed Plugins.
    Installed Plugins link under Plugins in the WordPress admin menu
  2. Select the checkbox at the top to select all plugins.
    Select all checkbox on the WordPress Installed Plugins screen
  3. From the Bulk Actions dropdown, choose Deactivate and then click Apply.
    Deactivate chosen in the Bulk actions menu with all plugins ticked
  4. If the error disappears, reactivate plugins one at a time, checking the site after each one, until the error comes back.
    Activate link highlighted under an inactive plugin in the WordPress plugins list
  5. If deactivating plugins didn’t help, go to Appearance > Themes and switch to a default theme like Twenty Twenty-Five.
    Activate button highlighted on the Twenty Twenty-Five theme card

If you’re locked out of wp-admin entirely, you can still do this over FTP. Rename the wp-content/plugins folder to plugins-disabled. This deactivates every plugin at once without needing to log in.

7. Check File Permissions

Wrong permissions stop the server from reading files it needs, and that can show up as a 400 error instead of a clearer message.

  1. Connect to your site through FTP or your host’s File Manager.
    FileZilla connected to a WordPress site
  2. Confirm that files are set to permission level 644.
    File permissions of 644 shown in FileZilla
  3. Confirm that folders are set to permission level 755.
    Folder permissions of 755 shown in FileZilla
  4. If any are wrong, right-click the file or folder, select File Permissions or Change Permissions, and update the number.
    FileZilla file permissions dialog with a numeric value
  5. Apply the change and reload your site.
    FileZilla log after a permission change

If you don’t have permission to change ownership yourself, this is a quick fix your hosting provider can make in a few minutes.

8. Raise Your Upload and Request Size Limits

Try this one if the error only shows up during uploads or big form submissions. When a request is bigger than PHP’s post_max_size limit, PHP drops all the form data. WordPress then finds no action in an admin-ajax.php request and answers with a 400.

  1. Check your current limits under Tools > Site Health > Info > Media Handling. Then connect to your site via FTP or your host’s File Manager.
    WordPress root folder opened in a file manager
    Media Handling panel in Site Health showing the post size and upload size limits
  2. Open or create a .user.ini or php.ini file in your root folder. Some hosts set these limits in their control panel instead.
    WordPress root folder where the PHP settings file goes
  3. Add these two lines. Keep post_max_size larger than upload_max_filesize because the PHP manual requires it:
upload_max_filesize = 64M
post_max_size = 72M
  1. Save the file.
    Save option in the file editor menu

On Nginx, the server also has its own body limit called client_max_body_size. Its default is 1 MB. A bigger upload gets a 413 error from Nginx and never reaches PHP. Ask your host to raise it if your uploads stop with a 413.

How to Fix the 400 Bad Request Error on Nginx

On Nginx, a 400 Bad Request that says Request Header Or Cookie Too Large means one request header was bigger than a header buffer. The Nginx docs set that buffer at 8k by default. The Cookie header is the usual culprit. Clear cookies first and then raise the buffer.

  1. Clear cookies for your domain or open a private window. If the page loads, an oversized cookie caused the error.
    Nginx 400 Bad Request page reading Request Header Or Cookie Too Large
  2. If it keeps coming back, add this line inside the http or server block of your Nginx config.
  3. Run nginx -t to test the config and then reload Nginx.
large_client_header_buffers 4 16k;

On managed hosting you can’t edit the Nginx config yourself. Send your host the error text and ask them to raise large_client_header_buffers for your site.

If your site sits behind Cloudflare, the 400 can also come from its edge. The Cloudflare 400 error guide lists malformed requests such as special characters in a URL that are not percent-encoded. Pause Cloudflare for a few minutes and retest to see which side sends the error.

If none of these eight fixes work, the cause likely sits deeper in your server setup. Send your host the exact URL, the time of the error and what you’ve already tried. That saves a lot of back and forth.

Fixing these errors yourself is doable. But if your site keeps throwing errors like this one, it usually points to a hosting environment or plugin stack that needs a proper cleanup. Our WordPress developers handle exactly this kind of troubleshooting. You’re not stuck renaming .htaccess files every few months.

How to Prevent the 400 Bad Request Error in the Future

Fixing the error once is one thing. Keeping it from returning takes a few small habits.

  • Keep plugins and themes updated: Most plugin-related 400 errors follow updates that change how a plugin builds requests. Check the changelog before updating anything that touches forms, checkout, or WordPress permalinks.
  • Avoid stacking security and caching plugins: Each rewrites headers, cookies, or .htaccess rules, and overlapping tools competing for the same request is a common, avoidable cause.
  • Set your PHP limits correctly once: If your store handles large product images or bulk CSV imports, configure upload and memory limits instead of raising them after every failed upload.
  • Clear your cache after major changes: After updating permalinks, migrating hosts, or changing CDN settings, clear your browser cache, WordPress cache, and host-level cache.
  • Back up before editing server files: Before touching .htaccess, wp-config.php, or file permissions, take a quick backup so any risky edit stays reversible.

Conclusion

The 400 bad request error on WordPress looks alarming, but it’s almost always fixable without a developer. Start with the simple stuff: clear your cache, check the URL, and resave your permalinks. Most of the time, that’s the whole fix.

If the error sticks around after that, work through the .htaccess, plugin, and file permission checks in order. A broken .htaccess file is behind more of these errors than people expect, and it’s one of the safest things to reset. Our guide to pretty permalinks in WordPress shows how the file and your permalink settings work together.

Keep your plugins, themes, and WordPress core updated, and this error will show up a lot less often going forward.

Frequently Asked Questions (FAQs)

Q1. Is the 400 Bad Request error the same on every browser?

No. If it only shows up in one browser, the cause is usually that browser’s stored cookies or an installed extension. Test the same page in a private window or a different browser to confirm before touching any WordPress settings.

Q2. Can a 400 error happen only when I’m logged into WordPress?

Yes, and it’s a common pattern. If the error only appears in wp-admin and the rest of your site loads fine, an expired session, an oversized cookie, or a security plugin blocking admin requests is the likely cause.

No. Resaving your permalink settings only rebuilds the rewrite rules that connect URLs to your posts and pages. Your posts, pages, and media stay exactly as they were.

Q4. Should I contact my hosting provider before trying anything myself?

Not necessarily. Most 400 errors trace back to browser cookies, a bad URL, or a corrupted .htaccess file, all of which you can fix yourself in a few minutes. Contact your host once you’ve ruled those out and the error still won’t budge.

Q5. Can a security plugin cause a 400 Bad Request error?

Yes. Some firewall and security plugins block requests they consider suspicious, including legitimate ones with long form fields or unusual characters. If the error appears only after submitting a form, temporarily deactivate your security plugin to test.

Rishi Yadav
Rishi Yadav

Rishi Yadav is a content writer at DevDiggers who covers WooCommerce store management, WordPress performance and security. He works through each topic in a test environment before writing about it. His guides focus on the steps and settings that matter and skip the ones that sound good on paper.

Leave a Reply

Your email address will not be published. Required fields are marked *