How to create a WordPress Child Plugin?


Child themes that you can create are convenient. But does exists a technology that provides a similar technology for plugins?

Unfortunately, this technology is not implemented by CMS. You can not just create a folder with the name like “<plugin_name>-child” and make changes in it. But sometimes you need to edit the plugins. What to do? There are alternative ways of doing this.

If you do not know what does mean “child theme”, then please read article Why We use Child Theme in WordPress.

Customization using hooks

This method is preferable because it is the most flexible and adapts for upgrades. If the plugin provides documentation that describes these hooks, then this is good. In popular plugins, it usually exists. It is also possible that when it does not describe them, then it is necessary to understand the plugin code and look for hooks. Look for the do_action (<hook_name>) function. It hooks. And use the add_action function to call them in funtions.php by example. Specify that the calls to these hooks work only when this plugin is activated.


If the developer created them, then it probably will support them in the next versions, so you can not worry about the release of new versions of plugins.


Not always the hooks are located where you need it. It is impossible to foresee all situations. So maybe you do not like this method.

Customization in a Theme

Some plugins provide the ability to edit through the template folder. Usually, you need to copy it from the plugin folder to the theme directory and rename it. Then they override the similar files that are in the main location. This method uses the popular plugin WooCommerce. They also made versions of template files so that you can determine when to migrate changes from a previous version to a new one so that everything works correctly.


It is very convenient because the technology is very similar to the child themes.


As in the first case, not always changes are available where necessary.

But what to do if the developer did not take care of the hooks and added the ability to edit the plugin using the template folder? To do this, you can create a “Pseudo-Child plugin”.

Creating a “Pseudo-Child plugin”

Create a folder in the plugin itself. When you make any changes to the code, you make comments that you can quickly find in the search. You can come up with some sort of keyword, for example, “#plugin_name_child”, where you can quickly find changed or added lines. Then you put these files in the previously created folder. Then copy the plugin’s shared folder with this folder to someplace. When you update, you analyze what has changed and thanks to the fact that we made comments in advance and know what files were edited, we can quickly re-render it for a new version. To make sure that someone does not accidentally update the plugin, you can disable updates for this file by using the code or change the version to very high digits, such as 99999 or something like that. But do not forget to track updates on the localhost or on the repository to do not miss out on something important, especially when compatibility issues with the new version of CMS WordPress are being addressed.


A very flexible way, because you can make changes anywhere.


When the new version comes out, compatibility problems may arise, you will have to remember the old changes and introduce new ones.

I hope I helped you and you determined for yourself which way is suitable in this or that situation. Please write what you think about it in the comments below.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Leave your comment