How to add additional Text Widgets in WordPress 2.3
We Bloggers as a group are quite creative in our own niche,we read a lot, write good informative posts(not always though) but, that does not mean we are technically sound as well. If this were a requirement of blogging I.d have never gotten far, but it is an advantage to have the ability to learn and work on a technical level. As a blogger you need to work on a computer with web based software and at times you.ll need to .tweak. your blog. Knowing how to do it yourself can be very handy. If you.re not this type of person, you might want to make friends with someone who is.
All WordPress users know that the Text Widgets in the Theme editor are the easiest way to post new components in the sidebar or the footer. However every WordPress theme has a limit of 9 text widget, but when I needed more I just found a way to get as many text widgets as required. The process is simple and if you have hosted your own WordPress blog, it would be easy for you to see this through.
Being said I’m not expert, I think this should work.
Well I changed few things in the widgets.php located in …./wp-includes
Buckup widgets.php file, you never know, if something fails don’t blame me ok?
Although to assure you I would like to say it has worked perfectly for me and now it shows 20 Widgets limit for!
The Process:
I searched for the code for widget_text and found:
Before Editing:
function widget_text_setup() {
$options = $newoptions = get_option('widget_text');
if ( isset($_POST['text-number-submit']) ) {
$number = (int) $_POST['text-number'];
if ( $number > 9 ) $number = 9;
if ( $number < 1 ) $number = 1;
$newoptions['number'] = $number;
You can see the number 9, so I changed it to 20.
After Editing:
function widget_text_setup() {
$options = $newoptions = get_option('widget_text');
if ( isset($_POST['text-number-submit']) ) {
$number = (int) $_POST['text-number'];
if ( $number > 20 ) $number = 20;
if ( $number < 1 ) $number = 1;
$newoptions['number'] = $number;
After that just few lines below that code there is this:
On the line (should be 885) with <?php for ( $i = 1; $i < 10; ++$i ) I changed number 10 to 21, remember, add one to the number of text widgets you set, so in my case I want 20 and this number is set to 21.
Before Editing:
function widget_text_page() {
$options = $newoptions = get_option('widget_text');
?>
<div class="wrap">
<form method="POST">
<h2><?php _e('Text Widgets', 'widgets'); ?></h2>
<p style="line-height: 30px;"><?php _e
('How many text widgets would you like?', 'widgets'); ?>
<select id="text-number" name="text-number"
value="<?php echo $options['number']; ?>">
<?php for ( $i = 1; $i < 10; ++$i )
After Editing:
function widget_text_page() {
$options = $newoptions = get_option('widget_text');
?>
<div class="wrap">
<form method="POST">
<h2><?php _e('Text Widgets', 'widgets'); ?></h2>
<p style="line-height: 30px;"><?php _e
('How many text widgets would you like?', 'widgets'); ?>
<select id="text-number" name="text-number"
value="<?php echo $options['number']; ?>">
<?php for ( $i = 1; $i < 21; ++$i )
After that, one more step, look for:
Before Editing:
function widget_text_register() {
$options = get_option('widget_text');
$number = $options['number'];
if ( $number < 1 ) $number = 1;
if ( $number > 9 ) $number = 9;
for ($i = 1; $i <= 9; $i++)
After Editing:
function widget_text_register() {
$options = get_option('widget_text');
$number = $options['number'];
if ( $number < 1 ) $number = 1;
if ( $number > 20 ) $number = 20;
for ($i = 1; $i <= 20; $i++)
And as before change “ALL” 9s to your needs, as for sake of this example I set it to 20.
Save the files and test that everything works fine, if everything fails revert to the original copy.
I think this should do it, if any more knowladgable guy think this is wrong and I’m missing something please correct me.
Again, before you do anything I advise you to back up a copy of widgets.php file. Just in case, it doesn’t work as expected, just paste the original code of widgets.php, and things will be set back to default of 9.
It worked for me, Hope it helps you guys as well.
If you have any questions, feel free to ask them in the comments!
If you like this post then please consider subscribing to my Full RSS feed. Join the Discussions about Blogging and Social Networking in the Forum.Thanks for visiting!
















3 Responses to “How to add additional Text Widgets in WordPress 2.3”
By Feroz Khan Hamid on Dec 5, 2007 | Reply
Thanks mate. This really helped me out!
By Charlie on Feb 19, 2008 | Reply
Thanks for guiding me through the process. Now have 20 text widgets. Will add your site to my favorites and reliable sites for WP updates.
By DM on Feb 20, 2008 | Reply
Glad I was able to help you out there Charlie. However I need to write an Update in this post, I would rather let you know in the comment beforehand.
The Text widgets work fine and cause no issues, however, when you update your Wordpress version, the widgets. php is rewritten and you lose the additional widgets and get the 9 original text widgets.
So after an update to avoid redoing the widgets .php file again and again, you can make a backup copy of the this file and after update paste the content into the updated version.
In this way you get the Text widgets back and have an updated blog.
Any questions or queries, feel free to ask!