What to try when remove_action doesn’t work

This one might seem like it’s an obvious “DUH” but it’s caught me up more than once, so I figured I’d write myself a note so I don’t spend hours digging thru forums.

Action hooks have to removed after they’ve been added (obviously), but sometimes a hook is added on the callback function of another one like this from the Genesis

add_action( 'admin_init', 'genesis_add_taxonomy_seo_options' );
 * Add the SEO options to each custom taxonomy edit screen.
 * @since 1.3.0
 * @see genesis_taxonomy_seo_options() Callback for SEO fields.
function genesis_add_taxonomy_seo_options() {

foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $tax_name )
 add_action( $tax_name . '_edit_form', 'genesis_taxonomy_seo_options', 10, 2 );


I kept simply trying to use a remove_action inside of my plugin file, but I could not for the life of me figure out why it would not remove the actions.

It turns out that by the time my code executed, the Genesis hook had not been added, so it could not be removed.

This did work

add_action("admin_init", "remove_genesis_actions", 11);
 function remove_genesis_actions(){

The moral of the story here, is that when an action that you want to remove is added during the callback function of another hook, you may have to add your remove actions inside of a callback function attached to that original hook with a different priority. (Say that 10 times fast)

In my case, I had to hook my remove_actions onto a later execution of the admin_init hook. This way all of their add_actions were in the queue when I removed mine.

Worpress Submenu Page External Link

Okay so I’ve officially hit the “this is why other developers start a blog” point.

I’m tired of digging through bookmarks and code snippers to see how I’ve done something in the past and for most stuff GitHub is just not an option for simple snippets.

I wanted to add a submenu item to a Custom Post Type that pointed somewhere else.

Here’s how to do it:

add_action( 'admin_menu' , 'dlb_challenge_redirects' );

function dlb_challenge_redirects() {
 global $submenu;
 $submenu["edit.php?post_type=dlb-challenge"][] = array('Manage Actions', 'manage_categories' , "[URL GOES HERE]" );

*Caveat – The menu you’re adding this sub menu page to must already exist.

Small Victories Deliver Big Contracts


This is a follow up to previous post about the 3 things you need to know to sell more. One my first mentors, Don Vogt, taught me that it's 10 times harder to replace an existing client, than it is to keep them. I've made it a mantra. I don't like … [Continue reading]

3 Reasons You Should Pay Attention to The Red Flags


Yesterday I had the distinct displeasure of digging through my inbox from 4/1/2011 to 8/1/2011 looking for an email. It was like taking a trip down Nightmare lane. As a freelancer, your gut instinct should be one of your biggest factors in making … [Continue reading]

Choice seating with the middlest bohi


[Continue reading]

Why You Should Always be The Dumbest Person in the Room (Even if You’re Not)

Smartest person

You can feed your ego, or you can feed your family. It can be hard to pretend to know less than you do, but it can pay off in spades. No one wants to enable or empower a competitor, but everyone likes to feel important, because they are being … [Continue reading]

The 1 Clause That Needs to be in All Your Contracts

Signing a form

I'm shocked how few creative professionals have formalized contracts. I'm even more shocked at how short and toothless those contracts are. If you're a creative services professional, you should have a service agreement or a contract for every … [Continue reading]

3 Keys to Selling More


Freelancers live and die by their ability to sell. Reputation can, and will get you far (if you've got the chops) but at the end of the day, sales is what pays for the roof over your head. I never really thought of myself as a sales guy, until I … [Continue reading]

Code.org — Why Schools Should Teach Kids to Program

Take a few minutes to watch the video, and you'll learn just how important it is for every kid in the United States to know how to code. I never imagined how much my life would change when Ben and Apoorav, told me that I had to learn python so we … [Continue reading]

Hanging with 2 little DeHavens


[Continue reading]