How to remove the plugin config from the WP database

Hi,

unfortunately I did a mistake in my wordpress database and as a result the plugin seems to write some data into a wrong section :frowning:

Each time a comment of a news article is pulled to the Wordpress installation, my Theme’s settings in the wp_options table get corrupted.

Removing and reinstalling the plugin does not help, there are still configs of the plugin remaining after reinstall, so it does not seem to cleanup its MYSQL data when it’s removed.

I need to fresh-install the plugin to get the issue solved, how can I remove its data from the WP database?

Did you take a backup of the DB before you installed the plugin? Does your host have backups?

What happens when the plugin is removed/disabled? Still corrupt?

WP plugin files are stored on disc and not all plugins remove these or their DB entries when they are removed. Can’t imagine Discourse code being errant like this though.

If you have access to the DB take a look and see what’s going on. To remove leftover plugin files you’ll need to FTP/SFTP in and delete them.


FWIW, the first rule of any kind of WP configuration is to take a backup before you do anything and… download it and keep it safe.

Or if you have the ca$h, sign up with somebody like WP Engine which has daily and on-demand backups of site and data. We have several clients hosted there and it works like a dream.

May not help you this time but…

2 Likes

Yeah, of course I have daily backups of everything, it’s a rented server in a datacenter and that’s sending a backup each night to my server here at home - and I could restore the old database, copy my theme settings, then go back (I did loads of changes due to the change from MyBB to discourse for my Community :grin:) and restore the Theme settings.

However, any time someone posted a comment in a thread which gets back imported to the Wordpress article, the theme went mad again.

What I initially did: I had to move my article comment forum to a new category after I saw that the plugin does not support sub-cats (they are not shown in the pulldown). But the new category was not listed in the dropdown, even not after disabling and reenabling the plugin. As there is no “refresh” button for the categories list in the dropdown, I went into the database and renamed the table “discourse” to “old_discourse”, reactivated the plugin and - yes, it created a new “discourse” table as expected. But still there have been no categories refresh.

So I deleted the new table again and renamed the initial table back to “discourse”. That seems to be a mistake.

Whatever I did, something gets messy resulting in the problem I’ve seen.

What solved it: I saw that deinstalling the plugin erased the two tables “discourse” and “discourse_version”, but the cache table was not erased. Also the discourse flags in posts_meta were still there. I need to erase all this in the database, then make a clean reinstall if the plugin - now it works again.

Finally it was my fault touching the database in the hope to trigger the plugin to see my new category. Not sure if the plugin need to take “its time” to present changes in the categories once it’s installed.

1 Like

WOW! It was not the discourse plugin! :blush:

It still happened … costs me hours. Several restore cycles later I found out that the initial design corruption happened when I have removed a “MyBB last posts” plugin (I’ve moved from MyBB to discourse, did not regret a singe second :+1:). That guy went mad!

Finally I found a (quite complex) way to get rid of that. Keep my thumbs pressed.

Thanks for your time reading this!

2 Likes