Remove a WordPress action in child theme

If you want to remove a WordPress action that was added in the parent theme like this:

function fusion_insert_og_meta() {
add_action( 'wp_head', 'fusion_insert_og_meta', 5 );

It’s VERY important to use the same priority value in the remove action in case a different value from the default (10) was used:

function remove_parent_actions() {
    remove_action( 'wp_head', 'fusion_insert_og_meta', 5 );
add_action( 'init', 'remove_parent_actions' );



You might also like

Fix plugins and themes installation when WordPress asks for FTP credentials
When WordPress doesn't have the right premissions on the wp-content folder it will ask for your FTP credentials...

Exit maintenance mode in WordPress when an update fails
To exit maintenance mode in WordPress when an update fails is as easy as deleting the .maintenance file...

SonataAdminBundle: Fix “The “ batch action is not defined” at app/vendor/sonata-project/admin-bundle/Controller/CRUDController.php in a shared hosting: magic_quotes_gpc
I was getting http 500 errors while deleting entities in SonataAdminBundle using the batch mode (selecting...

Use HTTPS protocol in WordPress 4.4+ for srcset attribute
I've started using "Let's Encrypt" in multiple sites I manage. Just after installing it for this blog...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.