PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How can I remove the Gravity Forms metabox from the Dashboard ?

  1. mike
    Member

    Hi,

    I am trying to remove the Gravity Forms metabox from the WP dashboard. Usually I use this to remove stuff from the dashboard :

    function remove_dashboard_widgets(){
      global$wp_meta_boxes;
      unset($wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard']);
    }
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

    But it doesn't seem to work with Gravity Forms. Does anybody know how to fix that ?

    Posted 13 years ago on Sunday April 24, 2011 | Permalink
  2. You did check the contents of $wp_meta_boxes to make sure $wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard'] exists?

    Posted 13 years ago on Monday April 25, 2011 | Permalink
  3. mike
    Member

    Hi illutic,

    No actually it doesn't. All I can see are the following meta boxes :

    dashboard_right_now
    dashboard_recent_comments
    dashboard_incoming_links
    dashboard_plugins
    dashboard_quick_press
    dashboard_recent_drafts
    dashboard_primary
    dashboard_secondary

    Nothing that seems to be the Gravity Forms box. But then, where is it ? If it is showing on the dashbord, why is it not in $wp_meta_boxes ?

    Posted 13 years ago on Monday April 25, 2011 | Permalink
  4. The problem is that your code is executing before Gravity Forms has registered the Dashboard meta box. Simply change the priority in your add_action() call and it should work for your. See below

    function remove_dashboard_widgets(){
      global $wp_meta_boxes;
      unset($wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard']);
    }
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets', 11);
    Posted 13 years ago on Monday April 25, 2011 | Permalink
  5. mike
    Member

    Thanks Alex, that did it !

    Posted 13 years ago on Monday May 9, 2011 | Permalink

This topic has been resolved and has been closed to new replies.