Increase Text Widgets in WP from mere 9 to a number you wish

by Shanker Bakshi on January 16, 2008

For those who switch over from Google’s blogger to Wordpress: one thing always annoy and that’s the limited number of text widgets. By default you only have 9 text widgets. I mean this is too little number. In blogger you enjoy the luxury of addition as many external HTML text widget as you wish. So I was looking for a plugin which can enhance number of text widget in Wordpress, but unfortunately there is no such plugin available (as far as I know).

Ultimately you have to experience this Wordpress hacking which will make you able to increase the number of text widget.

But before you do any WP hacking, its better you “Back up” original files!!!

1. You have to edit widgets.php file a little you will find widgets.php in the wp-includes folder find a chunk of code that begins with

function wp_widget_text_setup() Where it says
if ( $number > 9 ) $number = 9;
change 9 to x (x being the number of text widgets you want)

2. Next, find the chunk of code that begins with:

function wp_widget_text_register() change 9 to x in followings line:
if ( $number > 9 ) $number = 9;

3. Finally, look for this:

function wp_widget_text_page() Where it reads:

Change 10 to x+1 (i.e., one higher than your desired number of widgets)

IÂ WILL advise you to edit the file offline with your favorite editor. And then replace it with original. And yes please don’t blame me if the sky falls down on your head while doing so, though I hope you will be able to sail smooth with these instructions.

WP Text Widgets



Google Buzz
Related Posts with Thumbnails

Related Posts

{ 16 comments… read them below or add one }

Marlene December 18, 2007 at 4:58 am

This is interesting post, Shanker. I, myself, am not satisfied with only 10 text widgets so I usually put as many codes in one text widget. But I still need more, sure will try this trick. Thanks for this info.

Reply

jessie December 21, 2007 at 1:33 pm

this is truly helpful… i’ve long been wanting to increase the number of text widgets in my WP installation… no plugin is available (as far as i know) that can accomplish this task

Reply

Gary Speer January 14, 2008 at 7:30 am

I did the change as suggested. It shows up to 20 now in my drop-down for “Text widgets.” But when I selected 15 and saved the change — no additional text widgets showed up. There are still only 9 to work with.

Everything still seems to be working correctly with the blog, but it just didn’t really create more than 9 widgets. No harm, no foul, I guess. But it doesn’t seem to work?

Reply

Life is Colourful January 27, 2008 at 5:35 pm

I was thinking of looking for something like this and surprisingly came across it in here. I might give it a try, why don’t you create a widget out of it.

Reply

Darren February 8, 2008 at 6:51 am

I’m switching from blogspot to wordpress.org (self hosting)

This would be great as a plugin then you (we) could add any number of categories, text and RSS widgets as we would like.

Question: I changed my number of text widgets to 14. How do I get them to show up in the “Available widgets” area? Or did I just do something wrong?

Reply

tim morrison February 26, 2008 at 9:07 am

How do I edit the widget.php file in Wordpress 2.3.2?

Reply

JoLynn Braley March 7, 2008 at 5:46 am

Thanks Shanker, this was just what I was looking for. The only thing I am wondering about is whether or not widgets.php is overwritten each time you upgrade Wordpress….? If it is, then you’d need to make these changes each time you upgrade.

Reply

Robert Goodman March 19, 2008 at 8:19 pm

Bravo! Worked like a charm with zero hassles. Thanks!

Robert
http://www.ShouldYouStartACompany.com

Reply

Jennifer Farley July 13, 2008 at 10:46 am

Thanks very much for this. It worked perfectly. Was working on a client site who is still using WP 2.3 and I had no idea how to allow for more than 9 text widgets. thanks!

Reply

Shanker Bakshi July 13, 2008 at 10:47 am

Thanks for using and appreciating it.

Reply

Shanker Bakshi January 14, 2008 at 4:47 pm

it works, but you should be very careful making all the three changes required. I guess you mess up in code somewhere with RSS and Catagory codes which are exactly the same as for TEXT Widgets.

Reply

shanker bakshi February 8, 2008 at 1:52 pm

you have to make neccesary changes in your widget.php file, it will automatically increase the number in your widget panel like shown above.

Reply

Laura February 24, 2008 at 12:52 am

I had the same problem, then I figure out that something was missing in the post.
On the “function wp_widget_text_register()”, besides making the changes shanker tells us in the post you also have to change the 9 on this line: for ($i = 1; $i <= 9; $i++) {
than the widgets will appear on the available widget area.

Reply

Shanker Bakshi February 24, 2008 at 8:03 am

Thanks Laura, You are right, I missed it while writing the Post, Its Updated now.

Reply

Shanker Bakshi February 26, 2008 at 9:57 am

Edit it Off line, Copy the widget.php file on to your desktop and edit with a php editor software You can find one HERE then paste it again in your wp-include folder

Reply

Chris June 10, 2009 at 6:42 pm

Shanker, you mention to Laura that you have updated the Post to reflect her discovery, but it does not appear to be so.

Reply

Leave a Comment

Previous post:

Next post: