WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From what I've seen around the code, you can do this by hooking a function on admin_init, do you stuff and then die().

Is there a better way that follows "WP best practices" I'm missing here?

The page should not have any default body content, like the dashboard sidebar, but the admin scripts/CSS should be loaded normally.

share|improve this question
when you use die() you can rest assured that is not the proper way – HungryCoder Jun 18 '12 at 17:07
That's why I'm asking for alternatives – onetrickpony Jun 18 '12 at 17:08
Unless the administration page does not have any link in menu, how it will be accessed? if you want to access that page directly (putting URL in the address bar) and you don't want to embed the page inside wp-admin's layout, (i dont know exact way, honestly), i guess you can create a separate php file and include wp-config.php so that you can wp environments. from that page, you can handle the configurations. but its also surely NOT best practice. – HungryCoder Jun 18 '12 at 17:13
you can check this page. here i see some guidelines wordpress.stackexchange.com/questions/1778/… – HungryCoder Jun 18 '12 at 17:14

I think you can do a simple trick like this:

  • Create an administration page, just like normally using add_menu hook with default or low priority
  • Hook to admin_menu with higher priority and remove that admin menu item (or you can use a plugin like Hide Admin Menu to do that)

Removing admin menu after creating doesn't block you from accessing that page, it just hide the item in the menu, meaning if other people don't know the page slug (which you can make it unique and hard to guess) they can't access the page.

share|improve this answer
  • remove all admin menu
  • remove all dashboard widget
  • disable upgrade notification

you'll have blank dashboard and do your stuff


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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