The World’s Shortest WordPress Plugin

May 8, 2009  | 
9 Comments

We’ve been doing some seriously cool stuff with Barry of late but it’s been pretty chunky too and, in between mountains of code, decided it was time to clear the decks… get seriously Zen and look to the simple in life.

So, Barry challenges you to declare:

What’s the shortest, yet most useful, WordPress plugin (WP and/or WPMU) you’ve come across or can write yourself?

Length is measured from the start of the actual code, to the end (no need to count the bumpf up top), and quality is rated by usefulness, coolness and general bestness.

Make your submissions (your own, or other peoples plugins) in the comments! May the briefest win!

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

9 Responses to The World’s Shortest WordPress Plugin

  1. Ok, I’ll start. As James mentioned before, this is for plugins. The plugin must actually complete the task, but doesn’t need to include the “header comments”.

    Disable the flash uploader plugin:


    add_filter('flash_uploader', create_function('$flash', 'return false;'));

  2. Here’s a one liner I now use to force a blog’s printed pages to look the same as its screen pages.

    WYSIWYG Print Plugin:

    `add_action(‘wp_head’, create_function(‘$print’, ‘print “”;’) );`

  3. add_action('wp_head', create_function('$print', 'print "";') );

  4. Baa, sorry but the comment form borks the code. Here,
    http://wpmudev.org/project/Wysiwyg-Print/download

  5. Erg, sorry ’bout that, will put it in the mixer for upcoming wpmu.org redesign!

  6. Knocking off 9 characters from the original plugin. Makes it smaller but a little bit trickier to read:

    add_filter(‘flash_uploader’,create_function(‘$f’,'return 0;’));

    And, yes I know 0 in php technically isn’t false, but the check for $flash doesn’t use a explicit check for false (===) so it works in this case.

  7. I keep an emergency “disable all avatars” plugin handy to drop in mu-plugin “just in case”:
    function get_avatar() {}

  8. I never could get that style of function override to work properly, so I gave up on them :)

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting