What to Do If Plugin Deactivation Breaks Your Blog

Say you just disabled a plugin, and now your WordPress blog’s front-end says “Fatal error: Call to undefined function.” Part of your site may even be missing.

The problem is that your theme is calling on the plugin you deactivated. However, since that plugin is gone, the site displays an error and then stops rendering the rest of the page.

Here’s what to do:

  1. Go to your WordPress administration. Click “Design” (or “Presentation”), then click “Theme Editor”.

  2. Where on your site did the error appear? If it was on your sidebar, click “Sidebar.” If it was only on a search page, click “Search Template.” If it was in the comments section, click “Comments,” etc.

  3. Now look for a function call that might be related to the plugin you just deactivated. For example, if you deactivated the Related Posts plugin, you might see some code like this:
    <?php related_posts(); ?>

  4. If you don’t plan on using the plugin again, and if you’re sure the code belongs to the deactivated plugin, just delete the code.

    Or instead, you can follow these instructions to alter the plugin function call so that it won’t break your blog when the plugin is deactivated.

    (If you’re new to theme editing, you might want to backup your theme first just in case.)

  5. When you’re done, click the “Save” button to save your changes.

  6. If you couldn’t find any relevant code, or if the problem still isn’t fixed, repeat steps 3-5 for the rest of your theme files.

If all else fails, reactivate the plugin to get rid of the error, and then consult the plugin’s documentation, contact the plugin author, or file a support request at the WordPress Support Forums.

Did you enjoy this post? to get even more WordPress tips, news, and resources!

StumbleUpon

5 Comments

  1. Posted May 23, 2008 at 5:57 pm | Permalink

    Great write up!

  2. Posted June 1, 2008 at 10:22 pm | Permalink

    And after you fix your site the absolute next thing you need to do is contact the Plugin author and scream at them for not putting in the proper code to prevent these types of issues.

  3. African safari
    Posted June 3, 2008 at 1:39 am | Permalink

    I had a similar problem on my African safari holidays blog when i tried upgrading to a new version of cform plugin. The automatic upgrade function wasn’t able to upgrade and it also affected how i post articles. Later on i deleted all the files using ftp and after deactivating and reactivating the plugins everything was fine.

  4. Posted June 4, 2008 at 11:59 am | Permalink

    I always use the function_exists when adding plugin code to the template.

  5. Bear
    Posted October 27, 2009 at 9:06 pm | Permalink

    thanks, this article really helped me out!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*