Support » Fixing WordPress » Server Error after trying to update the functions.php

  • I recently tried to remove the right sidebar on my homepage.

    I added:

    add_filter( ‘sidebars_widgets’, ‘disable_all_widgets’ );

    function disable_all_widgets( $sidebars_widgets ) {
    if ( is_home() )
    $sidebars_widgets = array( false );
    return $sidebars_widgets;

    to functions.php as said in the tutorial, and updated the theme. It didn’t really work as I hoped, so I tried deleting the same line and updating it, but instead I got the server error as below and can’t access to my site.

    I get this message when I try to access to my site.

    Server error
    The website encountered an error while retrieving It may be down for maintenance or configured incorrectly.
    Here are some suggestions:
    Reload this webpage later.
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

    What should I do? Please help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Know that when you see ERROR 500, this can never comes from your files.
    Because it’s a Internal Server Error (eg: Apache… etc)

    You can try to restore the previous functions.php and theme files, but I think the error will occur again.
    Did you know if that theme is compliant ? Is it come from ? Because perhaps once you installed it, you were hacked !

    Hi Riversatile, thanks for your reply.

    I know that it’s not from the theme as I’ve tried it before on a different website and I never faced any problems with it. The theme I’m using is Custom Community.
    The minute I added that little piece of code in the functions.php the website broke!

    I am building this website for a university project which is due in two days, I’m really screwed and don’t know what to do! 🙁

    1. Make sure there’s no blank space after the closing php tag.

    2. Or remove the last closing php tag in functions.php, you don’t need it.


    Thanks for your reply,but how can I do that when I can’t even enter the site now! Every page I enter is broken.

    FTP client.

    FileZilla is a good one.

    That way you can access the files on the server and modify them.

    The problem is that it’s a university project, I don’t have access to the whole site, for example I can’t put in the host field cause I don’t know what the password is! I only have access to!
    Sorry for troubling you but I’m really stuck and don’t know what to do!



    Forum Moderator

    You need to contact someone with FTP access and ask them to activate the default theme on your site by renaming your current theme’s folder inside wp-content/themes and adding “-old” to the end of the folder name.

    Thanks a lot Esmi, Wpcanyon and riversatile for your help.
    I really appreciate it! I’ll try and see what happens wish me luck.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Server Error after trying to update the functions.php’ is closed to new replies.