Title: Call to undefined function wp_get_upload_dir()
Last modified: December 4, 2016

---

# Call to undefined function wp_get_upload_dir()

 *  Resolved [Carlos_FRS](https://wordpress.org/support/users/carlosfrs/)
 * (@carlosfrs)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/)
 * Updated last night to version 4.6 from 4.5.1 and had white screens across all
   my multisites. WP Debug logs showed thousands of \nFatal error: Call to undefined
   function wp_get_upload_dir() in /wp-content/plugins/contact-form-7/includes/functions.
   php on line 18.
    `$uploads = wp_get_upload_dir();’ Checked line 18 on version
   4.5.1 and saw different code. `$uploads = wp_upload_dir();` Reverted back to 
   4.5.1 for the time being and works fine. Probably could have changed the line
   in version 4.6 but didn’t have time.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8513566)
 * What version of WordPress do you use?
 *  Thread Starter [Carlos_FRS](https://wordpress.org/support/users/carlosfrs/)
 * (@carlosfrs)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8513677)
 * We’re using WP 4.6.1 in a multisite setup. Using a nginx 1.10 and php 5.6.27.
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8513850)
 * `wp_get_upload_dir()` should exist if you use WordPress 4.6.1.
 *  Thread Starter [Carlos_FRS](https://wordpress.org/support/users/carlosfrs/)
 * (@carlosfrs)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8514072)
 * Ok I will check my core files. Maybe something is off on my end. Thank you and
   thank you for such a great plugin. I will post back what I find.
 *  Thread Starter [Carlos_FRS](https://wordpress.org/support/users/carlosfrs/)
 * (@carlosfrs)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8519854)
 * Thank you again for your help. You were correct we found a few sub 4.6 servers.
   Issue has been resolved.
 *  [malcstewart](https://wordpress.org/support/users/malcstewart/)
 * (@malcstewart)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8652110)
 * Hi,
 * Just to add to this discussion, we have 2 mirrored installations of a site on
   2 different 1and1 hosting accounts (Europe). One of them works fine with CF7 
   version 4.6 but the other throws the same error as outlined above.
 * Both sites are on WP version 4.6.2.
 * We tried both the rollback to 4.5.1 and editing line 18 of includes/functions.
   php in the 4.6 version of the CF7 plugin’ **from** wp_get_upload_dir() **to**
   wp_upload_dir(). Both these options worked, so I don’t know what it is between
   our 2 different 1and1 accounts, but thought I would share this info for anyone
   having problems.
 *  [malcstewart](https://wordpress.org/support/users/malcstewart/)
 * (@malcstewart)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8652140)
 * UPDATE to note above: I updated the non-working version to WordPress 4.7.1, and
   reinstated the wp_get_upload_dir() and it’s working.
 * I can only imagine some problem occurred with the cloning of the site from one
   server to the other.
 * Great plugin – thanks
 * M
 *  [jacobross85](https://wordpress.org/support/users/jacobross85/)
 * (@jacobross85)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-8783632)
 * Changing wp_get_upload_dir() to wp_upload_dir() worked for me on WordPress 4.7.2.
   There must be an action that doesn’t call the wp_get_upload_dir() yet. Seems 
   to be a common issue as well.
 *  [rubyannrsls](https://wordpress.org/support/users/rubyannrsls/)
 * (@rubyannrsls)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-9247090)
 * Changing wp_get_upload_dir() to wp_upload_dir() worked for me too on WordPress
   4.4.5. Thanks for the information. This is a goldmine!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Call to undefined function wp_get_upload_dir()’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 9 replies
 * 5 participants
 * Last reply from: [rubyannrsls](https://wordpress.org/support/users/rubyannrsls/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_get_upload_dir/#post-9247090)
 * Status: resolved