What is the best way to modify a plugin? I frequently want to make small changes to one or two functions within a large plugin. This is easily done, but I have to use comments to mark my changes and modify the plugin again after an update. Ideally I'd like to leave the plugin alone and make my changes elsewhere, much like we do with themes and child themes. Can I make a plugin that requires the parent plugin and will override it?


6 Answers 6


IMHO, the best approach is either to fork the Plugin to maintain your changes, or else submit patches to the Plugin developer, to have your changes made a part of the original Plugin.

Creating a "Child Plugin" really isn't easy. The "Child Theme" concept really applies to the template files that get used, moreso than the Theme functions (and in fact, the functions.php file from both Parent and Child get loaded, which does cause problems for improperly coded functions.php files in either the Child or Parent Theme).

  • The types of changes I'm making are site-specific and so I don't think forking or submitting patches would be appropriate. I'll definitely keep those in mind for more general improvements to plugins. Commented Jul 14, 2011 at 12:57
  • But forking is basically what you're already doing. Basically, those are your options: fork, or patch. @Chris_O gives a good way to be able to pull in automatic updates from upstream, while maintaining your forked Plugin. Commented Jul 14, 2011 at 13:08

The "right" way obviously depends on the plugin. Some plugins are easier to edit than others, but most plugins can actually be modified by other plugins.

For example, if a plugin has a function hooked into WordPress with an action, then it's a simple matter for you to make another plugin that unhooks that function with remove_action, and then adds your replacement function in instead. This sort of method will let you replace individual functions in plugins with your own modified versions, without modifying the original plugin.

Same concept works with filters, obviously.

  • "As good" as the accepted answer. Combined they are a winner Commented Apr 28, 2022 at 20:07

The best way would be to just clone it and change the Plugin Name in the header and change the directory name. This way you could also have the original installed but not activated so you will still get alerts when updates are released.

Plugin Name: Name Of The Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: A brief description of the Plugin.
Version: The Plugin's Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
License: A "Slug" license name e.g. GPL2
  • This still requires going through new versions of the plugin to find changes (I suppose a version comparison tool would help) and then copying those changes over to my custom plugin. I suppose I could download the plugin and use SVN to merge the changes with my custom version. Commented Jul 14, 2011 at 12:42
  • 2
    There is a direct link to the diff file on the development log link on the plugins page. For example here is diff generated from W3 Total Cache
    – Chris_O
    Commented Jul 14, 2011 at 12:49

This is relatively easy if the plugin is under Git source control due to Git's distributed nature, but many WordPress plugins (and all of those in the official repository) are in Subversion. I use vendor branches and svn_load_dirs.php if I really need to modify a plugin, but this requires a reasonably high comfort level with Subversion.

If the plugin exposes no repository, I'd recommend turning it into a Git repository yourself and manually applying new versions.

In the end, version control systems are the only sane way to reapply changes to new upstream versions.


I agree with Annika Backstrom's answer, but I'd like to share my preferred solution.

Since most plugins are under svn, I use a tool called git-svn to make a git mirror.

Then, I just make a branch and commit my changes there.

When the plugin is updated upstream, I just pull from the svn repo and merge into my custom branch.


Since it hasn't been mentioned, you can replace any function that was made pluggable. Pluggable functions look like

if (! function_exists('function_name')) {
    function function_name() {

Then you can simply redefine the function yourself (in functions.php, Code Snippets, or your own plugin).

Unfortunately, most plugins don't make their functions pluggable; or at the best, only some of their functions are pluggable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.