One of the best, must have, plugins for WordPress is Shea Bunge’s Code Snippets.

Code Snippets is an easy, clean and simple way to add code snippets to your site. It removes the need to add custom snippets to your theme’s functions.php file.

If for any reason you need to export your code snippets, the plugin has a method integrated1.

Exporting All Your Code Snippets at Once

Export all Code Snippets at once.

To export all your code snippets at once, go to the code snippets listing in your WordPress admin area.

Make sure all your plugins are listed on one page before selecting them. Depending on the number of snippets you have, you may have to increase the number of items per page in the screen options for Code Snippets.

Select all snippets, then chose ‘Export’ from the drop-down menu and hit Apply. An XML file with all your Code Snippets will start to download.

To import your code snippets, select Import from the Code Snippets (sidebar) bar menu and chose the snippets XML file.

Get Code Snippets

If you don’t use the code snippets plugin yet, and still fiddle in your functions.php of your theme, get the plugin from now, or install it from within your WP Admin.

Contrarily to changes made directly to your functions.php, code snippets will remain active even after switching theme. Of course remember to make sure theme specific snippets are easy to recognize and deactivate should you switch theme.

  1. Because sadly enough the default WordPress exporter does not offer any option to export Code Snippets from the plugin.