Excluding files and folders while migrating with the All-in-One WP Migration WordPress Plugin

Daniel Olson | February 26, 2019

It’s no secret that the All-in-One (AIO) WP Migration WordPress Plugin is our go-to for moving sites. We even have a guide on how to use it for migrating to Shifter.

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

At the moment, AIO WP Migration doesn’t account for those folders and it includes them as a part of the backup. If you’ve experienced issues where the backup tiem is long or never completes, this could be the cause.

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

How to 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.

Ready to take your site to the next level?

Shifter is the solution for fast, maintenance-free WordPress websites.