I have created a page in my admin with this custom query:

$rows = $wpdb->get_results("SELECT * FROM ej_feedback ORDER BY createdtime ASC");

I have made it successfully paginate as required in that the right amount of posts show on first page and the right amount of pagination links show up. Awesome!

However when I click on one of the pagination links to go onto page 2, I get an admin error:

You do not have sufficient permissions to access this page

The url looks like this:


I really don't know why I'm getting this error in the admin. Is it a more general issue with the admin or is it related to using pagination in the admin area? Any help would be much appreciated.

The script works perfectly on the frontend - I just think Wordpress has a problem with the URL generated.

1 Answer 1


The last part of the URL is being treated as part of the page value..


The bold part is your plugin page, so when you go adding parts onto that URL it's considered to be part of that URL.

If you use this instead it should work no problem.


Note: You can actually reproduce the problem quite easily adding anything else on in the same manner, eg.


If you want pretty paged URLs for your plugin page you'll have to look into creating additional rewrites for those pages yourself, but that's perhaps for another question...(and not one i have time to answer - this particular issue was pretty easy to spot)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.