Title: Error when trying to export settings
Last modified: August 20, 2016

---

# Error when trying to export settings

 *  [DocEastin](https://wordpress.org/support/users/doceastin/)
 * (@doceastin)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/)
 * I just finished the setup for SEO and tried to export my settings. When I did,
   I got the following error message:
 * Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/
   ceastin/public_html/www.IdahoNaturalDentist.com/wp-content/plugins/wordpress-
   seo/inc/wpseo-non-ajax-functions.php on line 90
 * Anyone ever run into something similar? BTW, I’m a dentist, not a wordpress expert:)
 * Thanks!

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

 *  [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183388)
 * Yes, I’ve just got the same error on my website.
 *  [Scott Hendison](https://wordpress.org/support/users/cyber49/)
 * (@cyber49)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183533)
 * We ONLY get the word “Error:” and no more details – however – no dialogue box
   opens to download the settings. After the first one failed i found this post –
   then tried on two more sites on other servers and get same result. No error details–
   just blank – and no way to download settings.zip…
 *  [Scott Hendison](https://wordpress.org/support/users/cyber49/)
 * (@cyber49)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183534)
 * PS – Two of the sites were WP3.20 and one 3.21
 *  [g5fzvo](https://wordpress.org/support/users/g5fzvo/)
 * (@g5fzvo)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183572)
 * Yes, I’m getting the same thing on several WP blogs. Weird. I’d love to be able
   to move my settings around once optimized on one blog.
 * Exact error:
 * Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/
   bcrhodes/public_html/blogboxster.com/foundation/wp-content/plugins/wordpress-
   seo/inc/wpseo-non-ajax-functions.php on line 90
 * Anyone know of a fix for this?
 * Thanks.
 * – Brett
 *  [Lane Lester](https://wordpress.org/support/users/llester/)
 * (@llester)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183613)
 * I just want to add my “vote” to this bug report. Sure hope it gets fixed, because
   I have a bunch of sites I’d like to use this with and no desire to have to go
   through the whole process for each.
 * Lane
 *  [Aspired Muse](https://wordpress.org/support/users/aspired-muse/)
 * (@aspired-muse)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183614)
 * Also experiencing the same issue. Exporting worked fine last month. Hoping for
   a very quick fix.
 *  [trimark](https://wordpress.org/support/users/trimark/)
 * (@trimark)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183674)
 * I apologize for being a PHP hack, but the problem seems to be
 * Notice: Use of undefined constant WPSEO_UPLOAD_DIR – assumed ‘WPSEO_UPLOAD_DIR’
   in plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 79
 * Notice: Use of undefined constant WPSEO_UPLOAD_DIR – assumed ‘WPSEO_UPLOAD_DIR’
   in plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php on line 88
 * Warning: chdir() [function.chdir]: No such file or directory (errno 2) in plugins/
   wordpress-seo/inc/wpseo-non-ajax-functions.php on line 88
 * If someone has some input, I’d luv to have an answer
 *  [crisherent](https://wordpress.org/support/users/crisherent/)
 * (@crisherent)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183675)
 * Also experiencing the same issue.
 *  [Tony Hunt](https://wordpress.org/support/users/godfodder/)
 * (@godfodder)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183680)
 * Hi Joost,
 * Heh. I didn’t feel the impact of this feature being broken until today when I
   had to update ALL my sites.
 * So essentially this is hit me 15x today 😉
 * No hurries as today was the first time it would have helped, and I do want to
   thank you for this suite because it give me just enough direct influence to make
   the sites play ball properly.
 * Looking forward to seeing this out of beta!
 * -Tony
 *  [setuptips](https://wordpress.org/support/users/setuptips/)
 * (@setuptips)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183682)
 * There is a subtitle difference in that the dir must be an OS path when creating
   the file and a url when returning the file for download.
    There should also be
   a leading / on settings.ini and settings.zip
 * Here is my workaround. Try out at your own risk.
    NOTE: I have not tested the
   resulting import yet.
 * Additions market with > starting from line 80. Mods marked with |
 * > $upload_dir = wp_upload_dir();
    > $wpseo_upload_path = $upload_dir[‘path’];
   > $wpseo_upload_url = $upload_dir[‘url’]; | if ( !$handle = fopen( $wpseo_upload_path.’/
   settings.ini’, ‘w’ ) ) die();
 *  if ( !fwrite($handle, $content) )
    die();
 *  fclose($handle);
 *  require_once (ABSPATH . ‘wp-admin/includes/class-pclzip.php’);
 *  | chdir($wpseo_upload_path);
    $zip = new PclZip(‘./settings.zip’); if ($zip-
   >create(‘./settings.ini’) == 0) return false;
 *  | return $wpseo_upload_url.’/settings.zip’;
 *  [carolecross](https://wordpress.org/support/users/carolecross/)
 * (@carolecross)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183690)
 * Thanks setuptips! It works and you rock!
 *  [Lane Lester](https://wordpress.org/support/users/llester/)
 * (@llester)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183691)
 * Yes! Both the export and the import now work. Thank you very much for that patch.
   It took me a little while to read back through the thread and pick up which file
   to edit, so I’ll repeat that here:
 * The patch applies to wordpress-seo/inc/wpseo-non-ajax-functions.php
 *  [morcom](https://wordpress.org/support/users/morcom/)
 * (@morcom)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183692)
 * Yes thank you so much **setuptips**
    Fantastic – works for me too – thanks
 *  [Aspired Muse](https://wordpress.org/support/users/aspired-muse/)
 * (@aspired-muse)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183693)
 * Unfortunately, this didn’t work for me. I get the following error:
 * Parse error: syntax error, unexpected T_EXIT in
    /plugins/wordpress-seo/inc/wpseo-
   non-ajax-functions.php on line 84 (last line)
 *     ```
       $upload_dir = wp_upload_dir();
       $wpseo_upload_path = $upload_dir['path'];
       $wpseo_upload_url = $upload_dir['url'];
       if ( !$handle = fopen( $wpseo_upload_path.'/settings.ini', 'w' ) )
       die();
       ```
   
 * So what did I miss?
 *  [devonwoods](https://wordpress.org/support/users/devonwoods/)
 * (@devonwoods)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183697)
 * I found an even simpler solution that worked. Add the following lines to wp-seo.
   php:
 * define( ‘WPSEO_UPLOAD_DIR’, plugin_dir_path(__FILE__) );
    define( ‘WPSEO_UPLOAD_URL’,
   plugin_dir_url(__FILE__) );
 * Add them up top with the other ‘define’ declarations.

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

The topic ‘Error when trying to export settings’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 15 replies
 * 13 participants
 * Last reply from: [devonwoods](https://wordpress.org/support/users/devonwoods/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/error-when-trying-to-export-settings/#post-2183697)
 * Status: not resolved