• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Remove default WordPress widgets

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Remove default WordPress widgets

This topic is: resolved

Tagged: #unregisterwidget #prose

  • This topic has 6 replies, 3 voices, and was last updated 11 years, 4 months ago by Len.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • February 13, 2014 at 5:56 am #90110
    Eva Lim
    Member

    Hi I'm trying to remove the default Calendar widget from the Appearance>Widgets page on Prose theme.
    I've tried the code below (with and without a priority number) but it doesn't work. Any idea why? Thanks.

    //* Remove default widget from WP
    function remove_calendar_widget() {
    unregister_widget('WP_Widget_Calendar');
    }
    add_action( 'widgets_init', 'remove_calendar_widget' );

    February 13, 2014 at 6:29 am #90111
    Davinder Singh Kainth
    Member

    Refer -

    http://www.paulund.co.uk/how-to-remove-default-wordpress-widgets

    http://thomasgriffinmedia.com/blog/2012/09/remove-default-widgets-wordpress/


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

    February 13, 2014 at 6:53 am #90115
    Eva Lim
    Member

    Thanks for the quick response and links. I actually got my code from those two exact articles. But it's not working for some reason I can't figure out.

    February 14, 2014 at 12:50 am #90244
    Davinder Singh Kainth
    Member

    Ohk, I have tweeted about the problem. Someone should pitch in.


    Sunshine PRO genesis theme
    Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis Themes

    February 14, 2014 at 3:20 am #90248
    Len
    Participant

    Hi dogstalkpoetry.

    I'm not really up on the Prose theme because I've rarely used it but I think it has something to do with the fact it uses a special page for inputting custom php.

    I would just make a plugin out of it. Add this to the site's plugin folder ...

    <?php
    /*
    Plugin Name: Remove Calendar Widget
    Plugin URI: http://YourSite.com
    Description: Removes WordPress calendar widget from widgets page
    Author: Your Name
    Author URL: http://YourSite.com
    Version: 1.0
    */
    
    function remove_default_widgets() {
    	unregister_widget('WP_Widget_Calendar');
    }
    add_action('widgets_init', 'remove_default_widgets', 11);

    ... and name it something descriptive like remove-calendar-widget.php

    When you activate it the widget should be gone.

    An alternative is to make it a MU Plugin. (must use plugin)

    Create a folder in the wp-content directory called mu-plugins. So the wp-content directory should now look like this ...

    /wp-content
    /mu-plugins
    /plugins
    /themes
    /upgrade
    /uploads

    Add the plugin file from above to the mu-plugins folder. The advantage to this method is your new plugin doesn't have to be manually activated - it is automatically activated. It can only be deactivated by deleting the file. It's kind of foolproof if your dealing with clients.

    Let us know if it works for you.

    February 15, 2014 at 5:32 am #90461
    Eva Lim
    Member

    Both methods work perfectly. The 2nd method works only if the file is saved directly inside the mu-plugin folder (ie. no subdirectories.)

    Thanks guys. It's my first time creating a plugin! 😉

    February 15, 2014 at 11:44 am #90499
    Len
    Participant

    Hi dogstalkpoetry.

    The 2nd method works only if the file is saved directly inside the mu-plugin folder (ie. no subdirectories.)

    Yep. That's why I said "Add the plugin file from above to the mu-plugins folder." Perhaps I should have clarified further but glad to see you have it working. 🙂

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble