Support » Fixing WordPress » Please help – I killed WordPress

  • Resolved wordshine


    I broke WordPress by changing wp-settings.php and I need help to get it started again.

    I noticed in the database tables multiple copies of many posts, making me concerned about the disk space the extra, unnecessary copies were taking up. I found in the documentation that revisions can be limited. In wp-settings.php I changed WP_POST_REVISIONS from “true” to “3” and saved the file.

    The blog immediately fell over with:
    “Fatal error: Cannot redeclare is_admin() (previously declared in /home/wordmstr/public_html/climateconversation/wordpress/wp-settings.php:321) in /home/wordmstr/public_html/climateconversation/wordpress/wp-includes/query.php on line 99”

    I changed the value of WP_POST_REVISIONS back TO “true” again and saved the file.

    The php4 documentation does not say how to restart the database. I need some help, please.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Mark Ratledge


    Forum Moderator

    You can limit revisions, but it’s obviously not a good idea to hack core files. You limit revisons with define ('WP_POST_REVISIONS', 3); in wp-config.php: Editing wp-config.php « WordPress Codex or with a plugin WordPress › Revision Control « WordPress Plugins.

    You don’t need to restart MySQL. Logout and log back in to WP.

    Thanks for the advice, I won’t do it again! I read that wp-config.php was the place to define WP-POST-REVISIONS but when I looked at the file it wasn’t there. I impetuously decided to find out where it was and changed it there. Silly me.

    I cannot sign out, since I’m not “in” WordPress; I’m looking at an error message. So I closed down the browser, which usually signs me out of WordPress, but when I go back to my site I cannot get in. I get the same error about not redeclaring the variable.

    What should I do?

    Moderator Mark Ratledge


    Forum Moderator

    Delete browser cookies and clear your cache and see if that will kick you out of wordpress and force a relogin. Worst case, do you have a database backup?

    Thanks, songdogtech.

    Deleting cookies and cache has not let me in. I have a backup, but what else might I try to restore things? I have a local copy of all the WP files.

    Since the message does not mention the variable I changed – not even the file I changed – it seems WP might be altering its own files on the fly. Maybe I can put one back?

    Anyway, I appreciate your help. Is there anything else I can try or is it restore time?

    Moderator Mark Ratledge


    Forum Moderator

    WP is not altering its own files.

    Try getting a fresh download of WP and replacing just the file you changed; you might have edited it with a text editor that saved it in a different character setting or put junk characters in it.

    If that doesn’t work, what changed is a setting in the database; that’s why I asked about a backup.

    It’s useful to know that WP doesn’t alter its files.

    I’ve (again) replaced the file I changed, wp-settings.php, and this time it solved the problem. But it wasn’t caused by my word processor: I used the plain-text editor NoteTab Pro. I had cleverly changed and uploaded a copy of the 2.9.1 version of the file!

    I retrieved a fresh copy of the file, as you advised, and then I went to overwrite a copy in one of my working directories. But the file sizes were about 2K different so I had another look. Actually, a think. I remembered the local copy was probably from version 2.9.1, to which I’ve been trying to update WP. Which meant that the copy I had just placed on the server was from 2.9.1. When I replaced it everything went back to normal.

    You’ve got a nice-looking web site, Mark; you’re a real adventurer (with a good-looking beard!). I’ll read more of your site presently.

    Thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Please help – I killed WordPress’ is closed to new replies.