Adding code to to your website

Throughout our Knowledge Base, you'll find pieces of code which add or modify functionality in the MailChimp for WordPress plugin. To use these code snippets you will need to add them to your site in designated places, like the functions.php file of your active theme.

Warning! Adding code to your site requires some technical knowledge, as mistakes while adding the snippet can potentially break your site.

Use a plugin

The My Custom Functions plugin allows you to add custom code snippets to your site and comes with a few nifty features over the default WordPress theme editor.

Use a child theme

If you're using a theme that is built and supported by a third-party, it's a good idea to use a child theme. This will make sure that your changes will not be overwritten once your theme is updated. You can read all about how to do this in the WordPress.org Codex.

When you have a child theme in place, create a file called functions.php within the child theme directory.

Adding code

The code that you'll find throughout our knowledge base can be copy-pasted directly into your theme its functions.php file.

If there are any details that need to be changed before they work, we usually state this in the code snippet itself or in the article accompanying the snippet.

Make sure you copy the entire snippet of code to your file, as a missing character can lead to unexpected results.

Was this article helpful? ·