How to delete posts (pges) based on certain slug in their URLs in phpmyadmin


I really need help with few of my websites which have thousands of pages.

Now, i want to be able to write a command in SQL to say,

delete pages if their urls DON **NOT** conian one of these slugs [an array of slugs]

For example..
i want to keep pages which have this part of their url "**" + […another part of the slug….]


enter image description here

This is one slug i want to keep, but I have about 40 of them.

Other pages which don’t contain those slugs they should be removed.

So, what is the command that will do the job for me?

I really appreciate any help or hints as my websites crushing down because of this too many pages.

Thank you in advance.

shireef khatab 2 months 0 Answers 4 views 0

Leave an answer