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?