Your basket is currently empty!
Beware if you update to WordPress 2.5 and are using the very popular K2 theme.
If you are using K2 and you do update to 2.5, you will receive the following error on trying to browse to your WordPress dashboard:
Fatal error: Call to undefined function wp_register_sidebar_widget() in /path-to-blog/wp-admin/includes/dashboard.php on line 31
A bit of research told me that this is because K2 turns off WordPress widgets in favour of its own widget manager and as 2.5 has started to widgetize the Dashboard, you get this error.
To fix the error:
navigate to your K2 folder -> app -> includes
edit the file widgets-removal.php as below
Change the contents of the file from:
to
Your dashboard should now be browsable once more!
I knew I should have held off on updating longer. I blame Donncha!
Hello,
Welcome to my website where you’ll find my latest musings on all things related to sustainability, technology, and supply chain.
64 responses to “Fatal error: Call to undefined function wp_register_sidebar_widget() in…”
I upgraded 6 blogs over the weekend from various flavours of V2.x, all with different themes and upwards of 10 plugins. Zero problems so far. I think all the themes I was using were widget-enabled already. Genuinely surprised by lack of hassle.
I have been having trouble with a plugin that is essential for one blog.
Still, the 2.5 upgrade seems really nice.
Same problem hit me but I’ve been too busy to fix it. I so rarely view the dashboard anyway, although it’s become a lot more useful in 2.5!
There appear to be more problems than just not viewing the dashboard. Deleting spam, updating posts and more all cause failures. Everything works as it should, but you’re taken to an error page.
I hope the K2 community rises up in assistance!
Brilliant – worked for me first time. Thanks for sharing!
The recent svn version fixes the problem.
[…] you try to display the admin dashboard. I googled a bit and found a post which kind of fixed the problem but not quite. The altered code appeared at the top of every page. […]
Thank you so much for finally showing up in Google 😉
WoW, that saved me. Getting this error at 3am on April 1st, is not a pleasant joke.
Thanks for being so unfunny.
I just tried your fix to the same problem that you had. Now im getting a funny php thing at the top… Would you know the reason why this would happen? check the website out and see what i mean by this.
But thank you for the first workaround.
Jerome – I have no idea what is causing that error on your website.
Try going back to the file, selecting all, deleting and then copying in exactly the code from above, being sure not to have any extraneous spaces or anything.
Hope that helps.
[…] Si te aparece Fatal error: Call to undefined function: wp_register_sidebar_widget() in E:INetwwwrootunpuntonaranja.comrootwp-adminincludesdashboard.php on line 31 al entrar al tablero de WordPress, la solución, aquÃ. Una explicación mejor, aquÃ. […]
Tom, thanks for the solution!
[…] I’ve found a very simple solution on Tom Raftery’s Social Media Blog. Tom, thanks for sharing with […]
Thanks Tom,
I was checking a bunch of plugins on their compatibility with wp2.5 and suddenly that error kinda spoiled my enthusiasm.
Glad to see there was an easy (theme related) fix to it.
Enjoyed your Ecological Server-room session at the Plugg Congress in Brussels btw. And good luck with your Spanish adventure 😉
Jerome,
I believe it’s a matter of wrong encoding of that file. Please edit this file in more advanced editor (than Notepad for example) so you can set the appropriate encoding. I hope this helps 🙂
Thanks a lot, Tom. A simple fix — the best kind.
For me, I wasn’t using K2 and am still stuck with this error after upgrading… Anymore ideas? I had upgraded 4 different sites with no problems and with this site, I DIDN’T deactivate plugins. However, I’ve checked the list, and none seem to be incompatible…
Jerome:
The same thing happened to me. As Tom said, there’s an extra space. In my case, I copied/pasted the whole snippet, and the extra space was here:
< ?php
Remove the space between < and ?
Thank you all for your responses to my heartache.
I was looking and trying different things and found a link to another page that had the same fix but with comments in it… Copied simple text and pasted into my php doc and bam. Worked like a charm. Thanks for your help everyone and Tom
[…] Fatal error: Call to undefined function wp_register_sidebar_widget() in… 之後在Tom Raftery’s Social Mediaé€™è£¡çœ‹åˆ°è§£æ±ºçš„æ–¹å¼ æŒ‰ç…§ä¸Šé¢çš„修改之後 在main […]
[…] pesquisar sobre o problema no Google, encontrei a solução no blog do Tom Raftery: o tema K2 desativa o sistema de widgets do WordPress para que possa usar o […]
Thanks for that fix, and yes, the removal of the space at the beginning is crucial!
I had the same odd PHP script show up top after this fix – issue was the extra space in the first line of the next code. Changed it to
<?php
and it worked. So far at least, got to go try and turn on all my plugins again (yuck).
[…] Het probleem is, dat wanneer je de sidebar manager inschakeld, die op zijn beurt de WordPress widgets (waar het nieuwe dashboard nu ook gebruik van maakt) uitschakelt. Gelukkig vond ik het weblog van Tom Rafferty, die het probleem heeft getackled. […]
Thanks so much for this info Tom. A user on the WP forums posted this solution (with credit given to you ;)) when I ran into this problem myself last night. Very frustrating, but this fix worked like a charm. Thanks again.
[…] d’avoir, à savoir l’accès impossible au tableau de bord. Mais grâce à ce gentil Tom Rafteryit, et bien, vous pourrez à nouveau acceder à votre […]
Tom, Thank you. This was the easiest fix I’ve ever had to do, just search “Fatal error: Call to undefined function: wp_register_sidebar_widget()” and your post is the first result.
Good job man.
btw: DON’T JUST COPY/PASTE THE WHOLE THING LIKE I DID, Instead copy/paste from **IF** to (and including) the second to last **}** and replace that.
[…] Thank Tom for this article. Thưởng thức và chia sẻ: Những biểu tượng nà y liên kết đến các Websites, nÆ¡i các Ä‘á»™c giả có thể chia sẻ và khám phá các Websites má»›i. […]
Thank you for this article, please allow me to quote your article in my blog, this will help my friends fix this issue, I did put link back here at my the end of post at my site.
Linharex,
thanks for stopping by and commenting. Please feel free to quote this article in your blog.
Cheers,
Tom
Thanks for the fix, I was starting to panic! 🙂
[…] Nach längerer Suche im Netz bin ich auf folgendes gekommen:http://chaotictech.wordpress.com/2008/03/28/k2-wordpress-25-broken-i-can-fix-that/ -> besser der Code von hier […]
ty for the fix, first result in google is <3
Thanks- I was panicking when I started to get the error, but the solution turned out to be very simple thanks to you. Appreciate the help.
Someone from the WordPress forums pointed me to this post and I just wanted to say thank you!
Now if only you could solve all my other problems, hmm….
but really, thanks….much appreciated!
For me, it was the Now Reading plugin. I had to go to phpMyAdmin and find the activated plugins and delete the Now Reading plugin from there. After doing so, all is back to normal.
Thank you very much!
One more person here who benefited from this fix. Thanks, Tom!
hmm i did experience the same thing though right now i just used my backupand reverted my blog back to 2.3.2. im think of just waiting for the K2 compatible with WP2.5 which will be up soon as per dev’s notes. though im gonna try once more using the workaround you’ve given on my next free time.
however, i do have a question on one scenario i experience. i had another blog which uses k2 also. however the k2 sidebar manager is deactivated as im using wp’s widgets for it. when i upgraded it to 2.5, i didnt encounter a single problem and everything works fine. but im wondering and correct me if im wrong on my idea, IF ever i decide to activate k2’s sidebar manager, would it then cause an error? due to the said conflict on k2 and 2.5? and if it did, will your workaround still work?
im kinda not willing to try it yet as of the moment as if my hunce is correct and it suddenly causes an error, i dont have ample time to restore my blog presently.
what do you think? thanks
I can clearly say that the stable version of wordpress
http://wordpress.org/download/
and the latest K2 nightly build work nicely without any work around.
The latest K2 nightly
http://getk2.com/nightly/
can be found here. The SBM is more stable too for sure now.
WordPress 2.5 Fatal error: Call to undefined function wp_register_sidebar_widget() in…
Во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ WordPress до верÑии 2.5, при входе в админку вылезла ошибка: Fatal error: Call to undefined function wp_register_sidebar_widget() in …/dashboard.php. ПоиÑк в интерн…
[…] http://www.tomrafteryit.net/fatal-error-call-to-undefined-function-wp_register_sidebar_widget-in/ I followed the steps and managed to get into the admin interface for WordPress 2.5. But i am still getting weird code above the header and not being fluent in PHP like i would like to be i have few options…Look for a WordPress 2.5 version of K2 (will later) or change the theme… which i don’t want to do! […]
[…] a resolver este erro envolvendo o WordPress 2.5 e o tema k2. Para minha surpresa, rapidamente encontrei a solução no blog de Tom […]
That’s a beautiful thing my friend, worked perfectly. Thank you.
Thanks a bundle for this fix, Tom.
Now I’m informing one of the wordpress theme designers (which I’m using) of this error. 🙂
Regards.
[…] a solution online at the WordPress support. But the solution posted there came from another person; Tom Raftery. His research pointed him to another article relating to how the new K2 theme breaks WordPress […]
Thanks for that, a simple fix which had me worried for a short while!!
Thanks alot !
appreciate it.
Oh man, you cant guess how much did you help me!!
Thanks a lot, I will quote your site on mine. And you have a great name 😉 haha like me 😛
Kindest regards from Argentina
[…] I have had to search on Google (so fast, in fact) about K2 wordpress theme, but someone else called Tom who has a very helpful blog, answer all my questions in just one […]
This man is too much.
[…] Za?iatok môjho nového blogu postihol menší technický problém. Ke?že som si nahodil najnovšiu verziu 2.5.5, a chcel som aj tému K2, ktorú som používal aj na starom blogu, nemohol som sa dosta? do administrácie. K2 téma sa totiž “nekamaráti” (neviem ako to inak popísa?) s poslednou verziou WordPressu. Zjednodušene povedané, K2 akosi nevie obslúži? widgety na hlavnej stránke adminu blogu, ?o som sa dozvedel tu. […]
Hey Thanks for the help. Worked fine.
K2 is now 2.5 stable.
http://getk2.com/2008/04/k2-release-candidate-6-released/
Thanks again.
Thanks, you’re a life saver!
thanks, too! 😉
i have the same problem here:http://www.soundscapes.be/blog/wp-admin/
but i am not running K2.
it is triplek2 based upon K2.
I don’t have the file mentioned above.
I do have app/includes/sbm.php
i tried to replace this with the recent k2, but that didn’t work out well.
anyone an idea what I can do to fix the dashboard?
I don’t feel like making a new theme (it’s an modified theme which looks great in my opinion).
tx!
Also, the Sidebar Module Reloaded plugin produces this same error message and disables the Dashboard. Any ideas on how to get around this? I much prefer the SBM plugin to the WP built-in widgets. Much easier and nicer to navigate.
[…] Many thanks to Tom Raferty! […]
Hi, I’m wondering if you could tell me how to fix this error I’m receiving Fatal error: Call to undefined function require_wp_db() in /home/nabw9364/public_html/wp-settings.php on line 250
originally I had a couple other errors but knocked it down to this one since my widget.php file was in the wrong dir.
I started receiving errors when I accidently put a tracking code into my widgets instead of my sidebar.php. I’ve been spending hours trying to fix it and now I’m at a loss with this one. Any suggestions would be appreciated.
[…] jedoch läuft sowas wie ich mitbekomme sollte anscheinend bei Apple, denn hier rief ich bei der Hotline unter 0800 2000 136 an und hoffte noch auf unkomplizierte Kulanz. Nachdem […]
hello!
what if the fatal error is in the comment section?
how do i fix that?
thank you in advance!
cheers!
[…] Dinge, die ich einfach noch zu erledigen hatte. Leider kam ich dabei einfach nicht dazu hier etwas zu posten. Ab jetzt, da die Tage wieder kürzer werden, die Schulzeit aber nicht schreibe ich […]
[…] jedoch läuft sowas wie ich mitbekomme sollte anscheinend bei Apple, denn hier rief ich bei der Hotline unter 0800 2000 136 an und hoffte noch auf unkomplizierte Kulanz. Nachdem […]