Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Fix “Missing a Temporary Folder” Error in WordPress

This critical ‘Missing a temporary folder’ error in WordPress is a serious one.

We’ve found that it can prevent you from uploading images, updating themes and plugins, and even updating the WordPress core, severely hindering the functionality of your website.

In this article, we will walk you through the steps to easily fix the ‘Missing a temporary folder’ error in WordPress so that your website operates smoothly and efficiently.

How to Fix "Missing a Temporary Folder" Error in WordPress

What Causes ‘Missing a Temporary Folder’ Error in WordPress?

Is your WordPress website displaying the ‘Missing a temporary folder’ error? This common WordPress error is caused by incorrect PHP settings in your WordPress hosting environment.

There is a specific PHP setting that defines a temporary folder that apps like WordPress can use to temporarily store data. WordPress needs access to this temporary folder when you upload an image, install or update a plugin or theme, or update WordPress core.

If the location of this folder is not defined in your server’s PHP configuration, then WordPress will be unable to do any of these things and will show you the ‘Missing a temporary folder’ error.

The 'Missing a Temporary Folder' Error Message

You might want to reach out to your hosting provider and ask them to fix this for you. If you are not happy with the technical support you receive, then consider switching to a better WordPress hosting company.

Having said that, it’s also possible to fix the error yourself using a workaround. Let’s take a look at how to easily fix the ‘Missing a temporary folder’ error in WordPress.

How to Fix ‘Missing a Temporary Folder’ Error in WordPress

For this tutorial, you will need to edit the wp-config.php WordPress configuration file. If you haven’t done this before, then see our guide on how to edit the wp-config.php file in WordPress.

First, you will need to connect to your website using an FTP client or the file manager found in the cPanel dashboard of your web hosting account.

Next, you will need to locate the wp-config.php file and edit it.

You Need to Edit wp-config.php

You need to paste the following code snippet to the file just before the line that says, ‘That’s all, stop editing! Happy publishing.’

define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/');
Paste the Code Snippet Into wp-config.php

Save your changes and upload the wp-config.php file back to your website.

Next, you need to go to the /wp-content/folder and create a new folder inside it. You should name this new folder temp.

Create a Temp Directory in the WP-Content Folder

That’s all. You can now visit your WordPress admin area and try uploading an image.

If you still see the ‘Missing temporary folder’ error message, then you will need to check the folder permissions for your wp-content folder.

Using your FTP client, go to the root folder of your WordPress site. After that, you should right-click on the wp-content folder and select ‘File permissions…’

Check the File Permissions of the WP-Content Folder

This will bring up the file permissions dialog box. Now you need to enter 755 in the numeric value field.

Then you can click on the ‘OK’ button to continue.

Make Sure the File Permissions Are 755

You should now be able to upload images and perform updates on your WordPress site.

We hope this tutorial helped you learn how to fix the ‘Missing a temporary folder’ error in WordPress. You may also want to see our guide on how to set up WordPress error logs or our expert pick 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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

27 CommentsLeave a Reply

  1. Jacob Mathew

    If the above details is not working, Please check and verify whether upload_tmp_dir is enabled or disabled in your hosting provider’s configuration.

    If you need to verify this setting, you can check the php.ini file or use phpinfo() to see the current configuration

    In the php.ini file, you specify the temporary upload directory using the upload_tmp_dir directive. Here’s how to do it:

    Locate the php.ini File:
    Use the phpinfo() method to find the exact path if you haven’t already.
    Edit the php.ini File:
    Open the php.ini file in your preferred text editor. For example:bashCopy codesudo nano /etc/php/{version}/fpm/php.ini
    Find the upload_tmp_dir setting. (Search for upload_tmp_dir. If it’s not present, add it)
    Specify the Temporary Folder:
    Add or update the line to specify the path to your temporary directory:iniCopy codeupload_tmp_dir = /path/to/your/temp/folder
    Replace /path/to/your/temp/folder with the actual path where you want PHP to store temporary files. For example, it might be /var/lib/php/sessions.
    Save and Exit:
    Save the changes and exit the text editor (e.g., Ctrl + X, then Y to confirm in nano).
    Restart PHP-FPM version and Nginx or Apache

    • WPBeginner Support

      While that is possible to do, for most users we would recommend reaching out to their hosting provider and the host can normally check the status of upload_tmp_dir if that is the root of the issue should the other methods in our guide not solve the problem :)

      Admin

  2. Rojin

    I had the “Missing temporary folder” error today, with only one site, and the problem was an old theme. I temporarily switched theme to one of the default WordPress themes.
    define(‘WP_TEMP_DIR’, dirname(__FILE__) . ‘/wp-content/temp/’);
    This code and even the steps did not worked for me. Do you have any other methods to solve the issue.

    • WPBeginner Support

      If none of these methods worked for you, we would recommend reaching out to your hosting provider and see if they possibly have a setting that is overriding what you’re trying to do.

      Admin

  3. RT Helan

    I tried as you mention but still not working

    • WPBeginner Support

      If the methods from this guide do not solve the issue, we would recommend reaching out to your hosting provider for them to take a look at your folder permissions for you.

      Admin

  4. Luan Roloff

    I had the same problem when uploading new media files, updating my theme solved this problem for me.

    • WPBeginner Support

      Glad that solved the issue for you and thanks for sharing what worked for you :)

      Admin

  5. Brian Coogan

    I had the “Missing temporary folder” error today, with only one site, and the problem was an old theme. I temporarily switched theme to one of the default WordPress themes (‘twentytwentyone’) and the error disappeared, at least in my case. I could see a whole bunch of JS errors in the browser console log (F12 in Chrome).

    I did check out the temporary folder stuff above, but it didn’t seem to be key for me. Worth noting that my theme was VERY old and VERY broken (ie: PHP 5.6 days!), but just mentioning this in case someone else like me has tried everything else!

    I didn’t have time to check out what was happening in the code to produce this message, but just wanting to confirm that there’s at least one cause. In my case I’m the host and I’m sure the other sites on the server had no problem.

    • WPBeginner Support

      Thanks for sharing what caused this issue for you should someone else be looking for a reason :)

      Admin

  6. Shahzad Ghafoor

    I have edit wp-config.php and created a temp folder but also there is error and not going to upload any file except after doing this I can just find and install themes and plugins but can’t upload from pc.

    • WPBeginner Support

      If the first method in this guide did not work for you, we would recommend following the steps in our troubleshooting section.

      Admin

  7. Mel

    Thanks for this info. I had a site that had no issues previously with upgrading and then all of a sudden nothing would work – upgrades, uploads, etc. This fixed it. Thanks so much!

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  8. Paula Stewart

    Thank you so much for this, it really was easy to follow.

    • WPBeginner Support

      You’re welcome :)

      Admin

  9. Jigisha

    Thank you. It worked perfectly.

    • WPBeginner Support

      You’re welcome :)

      Admin

  10. Rabswudil

    Thank you so Much, God Bless you

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  11. Thami

    Hi all. Unfortunately I have tried to find the wp-config.php file in my cpanel, without any luck. It is just not there.

    • WPBeginner Support

      You may want to check with your hosting provider to ensure you are connected to the correct folder for your site

      Admin

  12. Siloru

    Thank you!! You saved my nerves…

  13. Mohsin

    Thanks’ it worked for me.

  14. Rowan

    Also this error shows up when you have reached your disk quota. I get many clients emailing me about this, but they’ve just been uploading huge files and their web hosting is full. Clear some space and it’ll work again.

  15. AR Badhon

    Thanks for Suggest..
    but i’m tried , before i’ll can’t upload . finish set to set guide line.
    pls Anyothers way

  16. evans kyei

    Add From Server plugin saved my time. it’s easy to use, just upload your image through ftp and use Add from sever plugin to import to your Media Library.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.