How to locate & delete hidden pages on a site

Posts/pages are stored in the wp_posts table. So you could get into the table and delete records. But, not recommended, unless you really know what you are doing with the tables.

My procedure would be to re-install WP (from the Update page; reinstall WP), then delete any non-WP (the ‘Twenty*’ ones) themes, and remove all non-needed plugins, and reinstall all the ones you need (deleting/removing then reinstalling might be better).

Then check for any files (via your file manager in cPanel) for any files with datestamps other than the date you reinstalled everything). Inspect those files for ‘badness’.

Another procedure would be to export your posts into an XML file, and import them into a brand-new-empty WP installation.

Of course, either of these procedures will remove any customization of code, themes, or plugins – and content. Even so, starting from scratch might be the best.

Depends on how much of the site content you need to ‘save’. But, a bunch of work on your part to get things back to normal.

(Assuming that you don’t have a known good / pre-hack backup of your site database and customized files.)

Good luck.