Unfortunately we don't really understand.... please help

Valued Support-Team,

two days ago we received the latest Whip Newsletter and are highly delighted about such thorough step-by-step guide to clean out our multi-db's...which has indeed highest priority.

However, our "understanding is very limited" and we need your help to get the job done.

Please be so kind and follow attached screenshot and explain us

- do we right, replacing # with e.g. "2" and "3" and so fort...

- which value do we have to use for "your-meta-key" also were do we find such value?

- do we have to change this "your-meta-key" value for each table?

Looking forward hearing from you soon.

Thank you in advance.
Kind regards
Prinz

  • Adam Czajczyk

    Hey Prinz,

    I hope you're well today and thank you for your question!

    - do we right, replacing # with e.g. "2" and "3" and so fort...

    That's the exact thing you want to do :slight_smile: The numbers should equal the ID's of the selected sites of your Multisite WP install.

    - which value do we have to use for "your-meta-key" also were do we find such value?
    - do we have to change this "your-meta-key" value for each table?

    This is a great question but I'm not able to give you an "out of the box" answer here. The "your-meta-key" is strictly related to the plugins you've removed. As you already know, most of the plugins do save data (this might be a configuration data or other information) inside the WordPress database. The simplest explanation would be that the "your-meta-key" is a representation of a name of such an option or information. However, there's no way to guess it.

    I suppose I could help you a bit with this if I knew which plugins have you disabled and removed. That said, it would be great if you could elaborate a bit on this!

    Cheers,
    Adam

  • Klaus

    @PrinzHi Adam,

    big thanks replying so promptly. We are glad doing first part right but...

    how about to solve "your-meta-key" if we can't remember at all which and how many plugins we had once active then deleted by time? All we know over time (we never really cleaned our db's) in total we deleted at least 35 and more plugins :slight_frown:(

    Any idea, how we can still clean the db's (without knowing those meta-keys) from previous liter? Independently from this circumstances, please could you give one sql query lets say we would have deleted the protected content plugin across all databases.

    The first part of this would be...
    DELETE from wp_iayq_2_postmeta WHERE meta_key = '?your-meta-key?'
    DELETE from wp_iayq_3_postmeta WHERE meta_key = '?your-meta-key?'

    Reason we are asking we could view our tables to find out ?your-meta-key?'.

    Thanks for helping us out.
    Cheers
    Prinz
    Indep

  • Adam Czajczyk

    Hey Prinz!

    how about to solve "your-meta-key" if we can't remember at all which and how many plugins we had once active then deleted by time? All we know over time (we never really cleaned our db's) in total we deleted at least 35 and more plugins :slight_frown:(

    This might be a tricky task anyway if you're not familiar with coding. That's because often there's no simple connection between plugin's name and names of database tables or fields (or "meta keys"). Furthermore, plugins may leave some data in other tables as well.

    Any idea, how we can still clean the db's (without knowing those meta-keys) from previous liter? Independently from this circumstances, please could you give one sql query lets say we would have deleted the protected content plugin across all databases.

    Since Protected Content isn't "live" anymore and the upgrade to Membership 2 has already changed the database structure, I must admit that I'm not able to give you a db query here. Fortunately, Protected Content itself didn't produce any posts so this shouldn't be a problem.

    As for example however, let's take our CoursePress plugin. In this case the modified query from your example would be:

    DELETE from wp_iayq_3_postmeta WHERE meta_key LIKE 'course_%'

    A word of explanation:

    - I replaced the "=" sign with "LIKE"

    That's because you're using "=" if you know an exact name of meta-key; CoursePress uses a few different meta-keys but this all start with "course_". Like is what I'd call here a "rough query" instead of an "exact query".

    - I've added the "%" sign at the end of the "course_" string

    This sign is a replacement for any number of any characters. It means that this meta-key name

    course_%

    equals

    course_ID

    and

    course_user

    as well as any other string that starts with "course_" part.

    I do understand that this may sound a bit overwhelming. I'd therefore strongly suggest that if you do wish to completely clean up your database without taking a risk of destruction you may want to backup your database and then ask a WordPress developer for helping hand here.

    You may want to ask for custom job at our "Jobs & Pros" job board here (no WPMU DEV staff involved):

    https://premium.wpmudev.org/wordpress-development/

    I'm sure you'll soon get a reasonably priced offer from one of the professional freelancers :slight_smile:

    I hope that helps!

    Cheers,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.