Overwriting a Shortcode in WordPress

Let’s say that we have a simple shortcode, such as this one:

If the shortcode is located in a plugin, it is not recommended to edit the plugin because you may lose any changes on a possible update.

The solution is to override the shortcode in your child theme.

So, in order to override the shortcode in functions.php, for example, simply copy and paste this code (and, addapt it to your current shortcode. this example only works with the shortcode from this page):

Leave a comment