Search code examples
phpwordpresswordpress-themingcustom-wordpress-pageswordpress-hook

How to customize/extend WordPress without getting impacted from future core/plugin updates?


I'm developing a website and need to customize WordPress using any of the following possible approaches:

  1. Search & Use native WordPress plugins as per the business requirement and customize them for as per the (business) requirement! This methods is easy to move with, although gets difficult to keep the customizations in sync with plugin's future updates.

  2. Should go ahead and write own custom-plugins for intended/specific features and manage/maintain. It also helps keeping the customization-code isolated. Using this method requires lots of development efforts, regular efforts for future-compatibility (more or less deprives us from community benefits, that come with WordPress and its plugin-community)

I wonder, how mature WordPress practitioners achieve future compatibility with WordPress Core, Plugins & Themes etc. for custom application development and what are the best practices to keep WordPress custom development compatible with future updates?


Solution

  • First of all - never modify the core WordPress files. There may be some circumstances where you have to, but if you have to ask the question "can/should I modify core files for this"? The answer is no.

    Secondly - you shouldn't be modifying plugin or theme files either, because modifications will be lost in updates.

    Now, about best practice. Typically, you'll find a plugin that works well enough to accomodate your client's needs and call it good. Many Good plugins will have relatively straightforward ways to modify or extend them using custom hooks or template overrides (look at Extending Gravity Forms with plugins, hooks, etc. as well as extending WooCommerce again with plugins, hooks, filters, template overrides, or custom API).

    Outside of extending plugins (not editing files directly), your best alternative is to write custom code to introduce the desired functionality, though that begins to introduce the issue of falling back to your for updates/security/maintenance, etc.

    So, never modify core files or plugin files. Either extend plugin functionality, or write your own code to achieve said functionality.