I have 900 media items on the site. For some reason the pagination has stopped working in a few sites and all the posts are being shown slowing down the site a lot. This happens on the Media library (/wp-admin/upload.php) and admin Posts list page too (/wp-admin/edit.php).
I've disabled all plugins. Posts per page is set as 20 via settings > reading.
I'm printing the query using a pre_get_posts - print_r($wp_query); and its says posts per page = 20.
Seems like the posts per page is getting messed up somehow? Any help appreciated.