What WP folder can I use to write files to?

Best place is the uploads directory – it’ll be writable by the server, and it’s the defacto directory for storing any user-generated/uploaded files:

$dirs = wp_upload_dir();
$path = $dirs['basedir']; // /path/to/wordpress/wp-content/uploads

Leave a Comment