Troubleshooting
WordPress an Error Occurred: Causes and How to Fix It

Short answer
It is a generic WordPress message shown when a request fails, most often during media uploads, plugin or theme installs, updates or saving posts. Match the exact wording to the task, then check upload limits, outgoing connections, file permissions, REST API access and plugin conflicts.
Key takeaways
- The message is generic; the fix depends on what you were doing.
- Upload errors usually come from size limits, file names or folder permissions.
- Install and update errors often mean the server cannot reach WordPress.org.
- Editor save errors often trace back to a blocked REST API request.
- Debug logs and the browser's Network tab reveal the real cause.
What does an error occurred mean in WordPress?
It is a generic message WordPress shows when a request fails without a more specific reason, usually during uploads, plugin or theme installs, updates or saving a post.
The wording varies. You might see An error occurred in the upload, An unexpected error occurred, or simply An error occurred. Please try again.
Because the message is vague, the fix depends on what you were doing when it appeared. This guide groups the common versions by task, explains the usual causes and walks through fixes for each.
Before you start, take a backup if you can still reach the dashboard. Some fixes involve editing files or the database.
Which version of the error are you seeing?
Match the exact wording and the task you were doing to the table below, then jump to the matching section for the fix.
| Message | When it appears | Most likely cause |
|---|---|---|
| An error occurred in the upload. Please try again later. | Uploading media | File size limits, permissions, memory |
| An unexpected error occurred. Something may be wrong with WordPress.org or this server's configuration. | Installing or updating plugins, themes or core | Server cannot reach WordPress.org |
| An error occurred while updating [plugin] | Updating a plugin or theme | File permissions, timeouts, disk space |
| An error occurred. Please try again. | Saving in the editor or admin actions | REST API, security rules, expired login |
| An error occurred while processing this directive | Visiting a page | Server-side include problem at the host |
If your message names a specific error code or file, that detail is the most useful clue. Note it down before trying fixes.
How do you fix an error occurred in the upload?
Check the file size against your upload limit, rename the file without special characters, confirm the uploads folder is writable, and raise PHP memory if large images fail.
This version appears in the media uploader. Work through these checks in order:
- File size. Media > Add New Media File shows your maximum upload size. If the file is bigger, raise the limit or shrink the file.
- File name. Rename files with spaces, accents or symbols to simple letters, numbers and dashes.
- File type. WordPress blocks some file types for security. Use a common format such as JPG, PNG, WebP or PDF.
- Folder permissions. The wp-content/uploads folder must be writable by the web server, usually 755 for folders.
- Memory. Very large images need PHP memory for resizing. Try a smaller image to test.
Our guide on fixing the upload_max_filesize error covers size limits in detail.
If the uploader shows an HTTP error instead, see how to fix the HTTP error when uploading images.
How do you fix an unexpected error occurred when installing or updating?
This message means your server could not talk to WordPress.org, so check your host's outgoing connections, DNS, firewall rules and SSL settings, or install the plugin manually.
WordPress downloads plugins, themes and core updates from WordPress.org servers. If your server cannot reach them, the request fails with this message.
Common causes include:
- Outgoing connections blocked by the host or a server firewall.
- DNS problems on the server, so it cannot find WordPress.org.
- Outdated SSL libraries on the server that fail the secure connection.
- A temporary outage on WordPress.org, which is rare and short.
Try again after a few minutes first. If it keeps happening, Tools > Site Health often shows a related warning about connecting to WordPress.org.
As a workaround, download the plugin zip from WordPress.org and upload it under Plugins > Add New Plugin > Upload Plugin. Then ask your host to check outgoing connections.
If Site Health shows a cURL timeout, our guide on fixing cURL error 28 explains the server-side fixes.
How do you fix an error occurred while updating a plugin or theme?
Retry the update, then check file permissions, free disk space and the PHP time limit; if the update stalls, delete the leftover .maintenance file and update manually.
Updates fail when WordPress cannot write the new files or runs out of time partway through.
- Retry once. Short network hiccups are common.
- Check disk space in your hosting panel. A full account cannot unpack the update.
- Check permissions. Plugin and theme folders must be writable by the web server.
- Raise time and memory limits if updates of large plugins time out.
- Update manually by uploading the new version through SFTP.
If the site shows Briefly unavailable for scheduled maintenance, an update was interrupted. Delete the .maintenance file in the site root to bring it back.
If an update leaves the site showing a critical error, follow our guide on fixing the critical error message.
How do you fix an error occurred when saving in the editor?
Make sure you are still logged in, check that the REST API works in Site Health, temporarily disable security or firewall rules, and test with plugins disabled.
The block editor saves through the WordPress REST API. If a plugin, firewall or server rule blocks that request, saving fails.
Work through these checks:
- Session. Open a new tab and confirm you are still logged in. Expired sessions cause failed saves.
- Site Health. Tools > Site Health reports REST API problems.
- Firewall. Security plugins and host firewalls sometimes block posts that contain code or certain words.
- Plugin conflict. Disable plugins one by one, starting with security and caching plugins.
- Site URL. Make sure the WordPress and site addresses in Settings > General match, including https.
The related message about an invalid JSON response has its own guide: fixing the invalid JSON response error.
For REST API warnings, see how to fix the REST API error in Site Health.
What does an error occurred while processing this directive mean?
This is a web server message, not a WordPress one, and it means a server-side include on the page failed, which your host usually needs to fix.
Apache shows this text when a server-side include, or SSI, directive cannot be processed. The Apache SSI documentation explains how these directives work.
WordPress does not use SSI, so the cause is usually a host configuration problem, a custom error page that uses SSI, or a broken file outside WordPress.
Check whether the message appears on every page or only some. Then contact your host with the URL and the time it happened.
How do you find the real cause when the message is vague?
Turn on WordPress debug logging, check your server error log, and use your browser's developer tools to see which request failed and what it returned.
Generic messages hide the real error. Three places usually reveal it.
Debug log. Add WP_DEBUG and WP_DEBUG_LOG to wp-config.php so errors are written to wp-content/debug.log. The official guide to debugging in WordPress lists the exact settings.
Server error log. Your hosting panel usually has an error log viewer. Our guide on checking PHP error logs shows where to look.
Browser developer tools. Open the Network tab, repeat the action and look for a failed request in red. The status code tells you a lot. MDN's list of HTTP response status codes explains each one.
| Status code | What it suggests |
|---|---|
| 403 | Firewall or security rule blocked the request |
| 413 | File or request too large for the server |
| 500 | PHP error; check the debug and error logs |
| 502 or 504 | Server timeout or proxy problem |
How do you rule out plugin and theme conflicts?
Deactivate all plugins, switch to a default theme, test the action again, then turn things back on one at a time until the error returns.
Conflicts cause a large share of vague errors, especially after updates.
- Deactivate all plugins from the Plugins screen.
- Switch to a default theme such as Twenty Twenty-Five.
- Repeat the action that failed.
- If it works, reactivate plugins one by one and test each time.
- The plugin that brings the error back is the cause.
If you cannot reach the dashboard, our guide on deactivating all plugins without admin access shows the file and database methods.
Use a staging copy if your site is busy, so visitors do not see a half-broken site while you test.
When should you contact your host or plugin developer?
Contact your host when logs point to server limits, blocked connections or SSI problems, and contact the plugin developer when one plugin reliably triggers the error.
Give them useful details:
- The exact error message and when it appears.
- What you were doing at the time.
- Any lines from the debug or error log.
- What you have already tried.
For plugin issues, the plugin's support forum on WordPress.org support is a good place to report it.
Clear details save a lot of back and forth, and help support find the cause quickly.
How do you prevent these errors in future?
Keep WordPress, plugins and themes updated, test big updates on staging, keep PHP limits sensible, and keep regular backups so any failure is easy to undo.
Most generic errors come back to a handful of causes: limits, permissions, blocked requests and conflicts. A tidy, updated site runs into them less often.
Check Tools > Site Health every month or so. It flags many of these problems before they turn into error messages.
Frequently asked questions
Why does WordPress just say an error occurred?
Some WordPress screens show a generic message when a background request fails and no specific reason is returned. The real cause is usually recorded elsewhere, such as the debug log, the server error log or the failed request in your browser's developer tools.
Is an error occurred the same as a critical error?
No. A critical error means a PHP fatal error stopped the page from loading. An error occurred usually means a single action, such as an upload or update, failed while the rest of the site keeps working.
Can a security plugin cause an error occurred message?
Yes. Security plugins and host firewalls can block uploads, updates or editor save requests that look suspicious. Check the plugin's logs, temporarily disable it to test, and add an exception for the blocked action if it is the cause.
Why can I not install plugins because of an unexpected error?
Your server is probably failing to connect to WordPress.org because of blocked outgoing connections, DNS problems or outdated SSL software. Upload the plugin zip manually as a workaround, then ask your host to check outgoing connections.
Will clearing my cache fix an error occurred message?
Sometimes. Cached admin pages or an expired login can cause failed requests, so clearing your browser cache and logging in again is a quick first step. Server-side causes such as limits or permissions need the fixes described in this guide.
Sources
- Debugging in WordPress WordPress Developer Resources
- REST API Handbook WordPress Developer Resources
- HTTP response status codes MDN Web Docs
- Introduction to Server Side Includes Apache HTTP Server
- Support Forums WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


