Most of the PHP based code examples in our documentation are hooks which could be pasted directly in your (child) theme’s functions.php. But if you update your theme files, these code changes will be overwritten.

The Custom Hooks plugin prevents any code changes from getting lost whenever your theme gets updated. It is basically an empty plugin file in which you can paste code.

How to use the Custom Hooks add-on

  1. Download the Custom Hooks add-on from your account page.
  2. Upload it to your wp-content/plugins folder and activate the plugin.
  3. In your site dashboard, browse to Plugins > Plugin File Editor. If you don’t see it, see below.
  4. Select “Custom Hooks” from the plugin dropdown (above the code editor), click “Select”.
  5. Paste relevant code into custom-hooks.php, then click “Update File”.

As an alternative to using the Plugin File Editor in WordPress, you can also manually paste the code into plugins > custom-hooks > custom-hooks.php and upload it with FTP.