All Collections
Migrating to Shifter
Migrating Entire WordPress Sites
Excluding Folders while migrating with All-in-One WP Migration
Excluding Folders while migrating with All-in-One WP Migration

How to exclude dependency folders such as node_modules

Tomohyco Tsunoda avatar
Written by Tomohyco Tsunoda
Updated over a week ago

It's no secret that the All-in-One (AIO) WP Migration WordPress Plugin is our go-to for moving sites.

When developing a custom theme you may use NPM along with other package managers. These create folders to store files necessary during development but they really don't need to get deployed into production.

By excluding these dependency folders or any folder you really don't need can dramatically reduce your sites backup size and save you time in your development process.

Excluding Folders

By adding this filter to your functions.php file you can target specific folders or files to exclude.

add_filter('ai1wm_exclude_content_from_export', function($exclude_filters) {
  $exclude_filters[] = 'themes/your-theme-name/node_modules';
  return $exclude_filters;

Another option could be to exclude your theme entirely. This is what we do and instead we track the development of our themes using Git.

If you want to give that a try, check out our article on how to develop WordPress themes on Shifter using Git with WP Pusher including some workflow examples.

Did this answer your question?