This guide shows you how to fix the WordPress upload error that reads "Missing a temporary folder." You usually meet it at the worst moment: you try to add an image to the Media Library, install a plugin or theme, or import content, and instead of the file appearing you get that short, unhelpful message. The same fault is sometimes described as "WordPress missing a temporary folder" or "temporary folder is missing", and they all point at the same thing. This article explains what the error actually means, why it turns up on otherwise healthy sites, and the two reliable ways to clear it: defining a temporary folder inside WordPress, and giving PHP a valid temporary directory through your Noiz hosting panel. It is written for Noiz clients who run their own WordPress site.
The reassuring part is that this is not a sign of a hacked, corrupt, or broken WordPress. It is almost always a small server-side configuration detail, most often a leftover setting from a site move, and once you understand where PHP looks for its scratch space the fix is quick. The official documentation tells you which constant to set; what it does not spell out is why the popular one-line fix sometimes fails to help, and that gap is exactly what this guide fills.
Last reviewed: 27 July 2026, against WordPress 7.0.2 (latest stable). This guide is written for Noiz hosting and is kept current against WordPress. It complements, and does not replace, the official WordPress and PHP documentation linked below.
Official Documentation Reference
- get_temp_dir() (WordPress Developer Resources): the core function that decides which temporary directory WordPress uses, and the order in which it looks.
- Editing wp-config.php (Advanced Administration Handbook): the reference for configuration constants, including
WP_TEMP_DIR. - File upload errors (PHP Manual): the definitive list of PHP upload error codes, including
UPLOAD_ERR_NO_TMP_DIR, the code behind this message. - The upload_tmp_dir directive (PHP Manual): what this PHP setting controls and how PHP behaves when it is missing or unwritable.
- Common WordPress errors (Advanced Administration Handbook): the official catalogue of WordPress error messages for wider context.
Prerequisites
- A way to reach your site's files: an SFTP client, or the File Manager in your Noiz hosting panel. The first fix edits
wp-config.phpand creates a folder, both of which live in your WordPress installation. - The ability to log in to your WordPress admin dashboard as an administrator, so you can reproduce the error and confirm the fix by uploading a test file afterwards.
- Access to your site's PHP settings in the hosting panel, or, on a managed plan, the option to ask the Noiz support team to change them for you. The second fix needs this.
- A copy of
wp-config.phpsaved to your own computer before you edit it, so you can put the original back if needed.
What the Error Actually Means
Understanding the message makes every fix below obvious. When you upload a file to WordPress, the file does not go straight to its final home in wp-content/uploads. First PHP, the language WordPress is built on, receives the incoming file and writes it to a short-lived scratch location called a temporary directory. Only once the whole file has arrived safely does WordPress move it into place. That temporary directory is the "temporary folder" in the error.
If PHP has nowhere it is allowed to write that scratch file, it abandons the upload and flags it with a specific code, UPLOAD_ERR_NO_TMP_DIR, known to PHP as error number 6. WordPress reads that code and prints the matching sentence from its own list of upload messages, which for code 6 is exactly "Missing a temporary folder." So the message is not WordPress complaining about itself; it is WordPress faithfully reporting that PHP could not find a usable scratch folder underneath it.
That distinction matters, because it tells you where the fix lives: in the server's PHP configuration, or in a WordPress constant that steps in to supply the folder. It is not something you repair by reinstalling WordPress or deleting plugins.
Do Not Confuse It With Its Neighbours
WordPress has a short family of upload errors that look similar but have different causes. Reading the exact wording saves you chasing the wrong fix:
- "Missing a temporary folder." is the one this guide covers: no writable temporary directory.
- "The uploaded file exceeds the upload_max_filesize directive..." means the file is simply too large for the current PHP limit, an entirely separate setting.
- "Failed to write file to disk." usually means the temporary folder exists but the final destination,
wp-content/uploads, is not writable or the disk is full.
If your message is one of the last two, this guide is not the right one. Only the first wording points at the missing temporary folder.
Why It Happens on a Healthy Site
Here is the detail most quick guides skip. Modern PHP, which every WordPress 7.0 site on Noiz runs, is forgiving about this: if no temporary directory is explicitly configured, PHP quietly falls back to the operating system's own default temporary location. Because of that fallback, a correctly configured site almost never sees this error. So when it does appear, it is worth understanding which of a small number of specific situations you are in, because that decides the cleanest fix:
- A leftover setting from a site move. This is by far the most common cause. When a site is migrated between servers, an old
php.inior a saved panel setting can carry an explicitupload_tmp_dirvalue pointing at a folder that existed on the old server but does not exist on the new one. PHP obeys the setting, looks for a folder that is not there, and fails. The fix is to correct or remove that stale value. - A path restriction blocking the system default. Some hardened setups confine PHP to a set of allowed directories. If the operating system's default temporary location sits outside that allowed set, PHP cannot use its normal fallback and reports the missing folder instead.
- A full or over-quota disk. A temporary directory that has run out of space behaves, for the purpose of writing a new file, as if it were not writable at all.
- Wrong permissions on a custom temporary folder. If someone has pointed PHP at a specific folder but that folder cannot be written to by the user PHP runs as, the same error follows.
You do not need to diagnose which one applies before you start. The two fixes below resolve all of these situations, and the troubleshooting section at the end helps if the first attempt does not stick.
Fix 1: Define a Temporary Folder in wp-config.php
This is the fix you can apply entirely by yourself, without touching any server settings, and it is the sensible first move. WordPress lets you name your own temporary directory with a constant called WP_TEMP_DIR. When this is set, WordPress's internal get_temp_dir() function returns it before considering anything the server offers, so you are supplying a folder you know exists and control.
Step 1: Create the Folder
Using SFTP or the panel File Manager, open your site's wp-content folder and create a new folder inside it named temp. The full path will be wp-content/temp. Keeping it inside your own installation guarantees PHP is allowed to reach it, which sidesteps the path-restriction cause described above.
Step 2: Add the Constant to wp-config.php
Open wp-config.php in your site's root folder, the same folder that holds wp-admin and wp-content. Just above the line that reads /* That's all, stop editing! Happy blogging. */, add:
define( 'WP_TEMP_DIR', dirname( __FILE__ ) . '/wp-content/temp/' );
The dirname( __FILE__ ) part resolves automatically to wherever your WordPress lives, so this line points at the temp folder you just made without you having to know the full server path. Save the file and, if you edited a local copy, upload it back. Placing the line above the "stop editing" comment matters: constants added below it are ignored.
Step 3: Check the Folder Can Be Written To
The new folder needs to be writable by the account your site runs under. On Noiz hosting, a folder you create through SFTP or File Manager is normally already owned correctly, so this usually needs no action. If you want to be sure, set the folder's permissions to 755. Avoid 777: it is not needed here and it weakens security for no benefit.
An Honest Note on What This Fix Reaches
This is the point the popular one-line guides gloss over, and it is worth being straight about. Defining WP_TEMP_DIR reliably fixes the error for the many operations that run through WordPress: installing and updating plugins and themes, importing content, and the many plugins (for example backup, import, and media tools) that use WordPress's own temporary-file handling.
However, when you drag an image straight into the Media Library, PHP receives that upload and looks for its temporary folder before any WordPress code runs at all, so in that specific case PHP's own setting, not the WordPress constant, decides success or failure. If the error only appears on direct Media Library uploads and Fix 1 has not cleared it, that is expected, and Fix 2 is the one that will. Applying both is the belt-and-braces approach, and doing Fix 1 first costs nothing.
Fix 2: Give PHP a Valid Temporary Directory in Your Panel
This is the definitive fix, because it corrects the setting PHP itself reads. There are two ways to go about it, and the right one depends on the cause. If a stale value is pointing PHP at a folder that no longer exists, the cleanest fix is simply to remove that value so PHP returns to using the reliable system default. If instead PHP is being blocked from the system default, you point it at a folder inside your own account. Either way, the change is made in your Noiz hosting panel's PHP settings, and the exact place depends on which panel your site is on.
Where you do point PHP at your own folder, use a directory inside your hosting account that you know is writable, such as the same wp-content/temp folder from Fix 1, and give its full server path. The directive you are setting is:
upload_tmp_dir = "/full/path/to/your/wp-content/temp"
Replace the path with the real absolute path to a writable folder in your account; your File Manager shows this path when you open the folder.
On Plesk (neo.noiz.co.za)
For sites on the South African platform, open Websites & Domains, select your domain, and click PHP Settings. Scroll to the Additional configuration directives box at the bottom of the page. This box accepts raw PHP directives, so add your upload_tmp_dir line there, then click OK or Apply. If the cause is a stale directive that was set here previously, remove that line instead of adding one. Plesk also provides a per-subscription temporary area for each site, and Noiz support can confirm the correct path to use if you are unsure.
On ISPConfig
For sites on the ISPConfig platform, open the site under Sites, then switch to the Options tab. In the Custom php.ini settings box, add your upload_tmp_dir line, then save the site so the change is written out and the PHP handler reloads. As with Plesk, if a leftover value is already present in that box and points at a folder that no longer exists, the fix is to delete that line rather than add another.
On DirectAdmin
For sites on the Ireland platform, the equivalent lives in the domain's PHP configuration, where DirectAdmin lets you supply custom PHP directives for the selected PHP version. Add or correct the upload_tmp_dir value there and save so the setting is applied. If the exact location is not obvious in your account, the Noiz support team can point you to it or make the change for you.
The Managed-Plan Shortcut
If your site is on a managed Noiz plan, you do not have to work through the panel at all. Open a ticket, quote the exact error, and ask the Noiz support team to set a valid PHP temporary directory or clear a stale one for your site. Support can also see at a glance whether a path restriction or a full disk is the underlying cause, which is harder to spot from inside your own account.
Fix 3: Rule Out Permissions and Disk Space
If both fixes above are in place and the error persists, two server-level conditions are worth eliminating, and they are the usual reason a correctly configured folder still fails:
- Permissions. The temporary folder must be writable by the user your site's PHP runs as. If you created the folder yourself over SFTP this is normally fine; if it was created by a different process it may not be. Confirm the folder is set to
755and owned by your hosting account. - Disk space and quota. A temporary folder on a partition with no free space cannot accept a new file, which produces exactly this error even though the folder plainly exists. Check your disk usage in the hosting panel. If your account is at or near its limit, clearing space, or asking Noiz support to review your quota, resolves it.
These two are also the most common reason the error appears suddenly on a site that worked yesterday with no configuration change: the disk quietly filled up, or a routine tidied a folder and reset its permissions.
Verify the Fix
Do not assume the change worked; prove it. Once you have applied a fix, go back into your WordPress dashboard and repeat the exact action that failed. If it was a Media Library upload, upload a small test image. If it was a plugin install or a content import, run that again. A clean upload, with the file appearing where it should, is your confirmation.
If you edited wp-config.php and want to leave the site tidy, there is nothing to undo: the WP_TEMP_DIR line is a permanent, harmless improvement and is fine to leave in place. This is unlike temporary debugging settings, which you would remove afterwards.
Troubleshooting
- Symptom: the error only happens on direct Media Library uploads, not on plugin installs. This is the expected split explained above. PHP handles the raw upload before WordPress does, so the
WP_TEMP_DIRconstant alone will not cure it. Apply Fix 2 so PHP itself has a valid temporary directory. - Symptom: the error started immediately after moving the site to a new host. A stale
upload_tmp_dirfrom the old server is almost certainly the cause. In your panel's PHP settings, look for an existingupload_tmp_dirline pointing at a path that does not exist on the new server, and remove it so PHP falls back to the working default. - Symptom: you added the
WP_TEMP_DIRline but nothing changed and the site looks the same. Check that the line sits above the "stop editing" comment inwp-config.php, that thewp-content/tempfolder actually exists, and that you uploaded the edited file back to the server rather than only saving your local copy. - Symptom: uploads fail with a different message, such as one mentioning
upload_max_filesizeor "Failed to write file to disk." That is a different error with a different cause, covered by file-size limits or destination-folder permissions rather than the temporary folder. Match the exact wording to the right fix. - Symptom: everything looks correct but the error keeps returning. The temporary partition may be full or your account may be over quota, so a folder that exists still cannot accept a file. Check disk usage, or ask Noiz support to review it for you.
When to Contact Noiz Support
Most people clear this error with Fix 1 and Fix 2 in a few minutes. Some causes, though, sit at a level you cannot see from inside your own account: a path restriction on the PHP handler, a disk that has filled up, or a leftover configuration set during a migration. On managed Noiz hosting, support can inspect the PHP configuration directly, set or clear the temporary directory for you, check your disk and quota, and confirm the folder is writable by the right account.
If you get stuck, open a support ticket with the Noiz support team and include your domain, the exact error text (a screenshot is ideal), which action triggers it (a Media Library upload, a plugin install, or an import), and whether anything changed recently such as a site move or a spike in disk usage. That last detail usually points straight at the cause.
