Support » Plugin: Akismet Anti-spam: Spam Protection » Remove Akismet Widget

  • Resolved Pam Blizzard

    (@pdblizzard)


    I’ve sucessfully unregistered some default widgets for a customer, but I am not able to remove the Akismet Widget from the Dashboard. There is no way this customer ever wants to use the widget and feels it’s taking up valuable screen space.

    I used the following code found here: https://plugins.trac.wordpress.org/ticket/1310

    function removeAkismetWidget() {
            unregister_widget( 'Akismet_Widget' );
    }
    add_action( 'widgets_init', 'removeAkismetWidget' );

    But it’s not working. What is the appropriate way to remove the Widget from the Dashboard without using CSS? ( which is not preferable of course.)

    https://wordpress.org/plugins/akismet/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Christopher Finke

    (@cfinke)

    Raise the priority argument of your add_action so that the widget is guaranteed to be registered when you try to unregister it:

    function removeAkismetWidget() {
            unregister_widget( 'Akismet_Widget' );
    }
    add_action( 'widgets_init', 'removeAkismetWidget', 11 );
    Thread Starter Pam Blizzard

    (@pdblizzard)

    Works perfect, thank you, I learned something new (priority).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Akismet Widget’ is closed to new replies.