Pushing Development to Production -- which files?

I’m setting up my local dev environment for a roots-based site. Which files should I upload to the main server? Just the roots theme directory? Also the assets to push the js and css files?

Any guidelines or tips?


You will probably need the database as well, just like any other Wordpress site.

JS and CSS should be in your theme directory. If you are pushing into an existing WP install and migrating the database, then you will need the following at a minimum:

  • Theme folder (/wp-content/themes/your-theme/)
  • Media uploads folder (/media/)
  • Plugins folder (/wp-content/plugins/)
  • .htaccess file from the root directory

This seems like a silly question but would I be right in saying I shouldn’t upload files like package.json and gruntfile.js to production?

package.json and gruntfile.js should be checked into the repository. For production, they’re probably not necessary, but they won’t hurt anything either.

The only thing to be aware of with any files that are in your production webroot is if they’re publicly accessible and if they contain sensitive information. If your gruntfile.js contains any credentials for example, you should definitely make sure to block it in Apache or Nginx or don’t copy it to production.