I've set up some admin pages using add_sub_menu() and whenever I add an additional querystring variable beyond the "page=" portion of the URL, I get a "Cannot load 'page-slug'." message. When I remove the every variable the page loads correctly. Here is my add menu code:

  __( 'Post Types - Add', 'plugin-slug' ),

If I browse to:


it works fine. But browsing to:



Cannot load content-toolkit-posttypes-add.


You're recieving this error because WordPress notices the post_type query argument and that sampletype is a valid registered post type, and thinks you're on an edit page. Try using a different query arg then post_type.

Note that admin.php?page=plugin-slug-posttypes-add&post_type=thisisnotaposttype and admin.php?page=plugin-slug-posttypes-add&foo=bar will both work fine.

| improve this answer | |
  • I didn't realize using that specific variable name would affect it. Thanks! – hereswhatidid Jun 15 '13 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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