Deactivate WordPress Default Widgets

You do not always want to have all the widgets active, which comes within the WordPress core.

You can disable the unneccessary Widgets in your functions.php of your theme with a small function. The following syntax will switch off all the standard widgets. It should therefore be adjusted depending on your requirements:

// unregister all default WP Widgets
function unregister_default_wp_widgets() {













add_action('widgets_init', 'unregister_default_wp_widgets', 1);

The function unregister_widget() needs as parameters the class, therefore the code is working since version 2.8 only. In prior versions, Widgets were supported differently.

How to create your own Widgets since WordPress Version 2.8 is explained in Build A WordPress 2.8 Widget With The New Widget API.

Disable Flash Uploader

Not always is the Flashuploader of WordPress a blessing and several times I preferred to have it switched off. Usually if the blog is not online and is offline behind a proxy and firewall.


With the help of the Browser uploaders there is less trouble and therefore easy to abandon the added value of Flash uploaders, like loading multiple files simultaneously. You can disable the Flash uploader by using a filter. This can be done either in your theme, stored in the functions.php or in a Plugin. I use the option of switching off with the help of the Plugin Adminimize. Alternatively, the following syntax helps and the browser uploader will be available only.

Continue reading …

Change the WordPress Message

The notifications of WordPress for the author of an article or comments are not always right on the spot according to the needs. WordPress also knew that and created these functions so that it's easy to adapt notifications to your needs or can completely be replaced. Therefore, I will briefly show how to adjust the mails to your needs.

The two functions wp_notify_postauthor() and wp_notify_moderator() are used to send messages, but can be replaced. You can find these two functions in wp-includes/pluggable.php and there are all the functions included, which WordPress queries (if ( !function_exists('set_current_user') )), so that you can replace it easily. Therefore, it is a simple task to adjust the notifications in your WordPress installation.

Continue reading …

Use WordPress Cache

WordPress has an internal cache, also for extensions can be used. There are various functions available and you don't have to create something new, you can easily use the cache functionality of WordPress.
To get to know and understand the features a little bit, I use a small example, therefore I cache in the following tutorial a feed, which should be displayed in the frontend.

All functions of cache are in the Codex by WordPress listed, so a look at the Codex is worthwhile if you deal with the syntax.

The first cache solution came with WordPress 2.3 and was file based. The cache was optional and had some parameters to configure.
You were able to activate via following constant: define ( 'ENABLE_CACHE', true);
Continue reading …

Warning Message For Self Customized Plugins

Now and then you have to modify an existing Plugin for your own special needs. But you still get a message if an update exists for the original Plugin. If you modified the Plugin several month ago and you forgot about it, so you update the Plugin and all your modifications are gone. Most of the time you have a backup, but even though it's annoying to upload the customized Plugin again after you realized the original Plugin is not exactly what you want. Therefore you can paste a little function in the specified Plugin to display a warning right after the update message. So you won't forget, that you modified this Plugin a while ago.


function my_update_notice() {
	$info = __( 'ATTENTION! Plugin was modified.', MY_TEXTDOMAIN );
	echo '<span class="spam">' . strip_tags( $info, '<br><a><b><i><span>' ) . '</span>';

if ( is_admin() )
	add_action( 'in_plugin_update_message-' . plugin_basename(__FILE__), 'my_update_notice' );

Related Posts on Category

It's not easy to keep your readers on your website. It's a challenge to provide new readers valid information, even though they were written a while ago but still up to date. A good idea is to provide posts from the same category as the post, the reader is reading currently. You can create a little function, which is listing related posts based on the category ID.
Continue reading …