Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6690009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:35:12+00:00 2026-05-26T05:35:12+00:00

In WordPress, I am trying to get a script to work, which runs in

  • 0

In WordPress, I am trying to get a script to work, which runs in my plugin’s directory and gets directly called by the browser via its URL, e.g. http://www.example.org/wp-content/plugins/myplugin/script.php. The script should only be available for logged-in admins.

What I tried to do was to include /wp-admin/admin.php at the very beginning of the script, to bootstrap WordPress’ functionality, and to check for the sufficient permissions. However, during this bootstrapping process, WordPress redirects me to the log-in-screen, even tough I already am logged in. That is, because the WordPress-authentification-cookie isn’t available outside the /wp-admin-directory.

So, because my approach obviously doesn’t work, I was wondering: What is the best practice to run WordPress-admin-scripts, outside the admin-directory? Is there some “wrapper”-script inside /wp-admin I could use, like there is admin-ajax.php for AJAX-calls? Or isn’t it even WordPress, but just my server-configuration that the auth-cookie is only available in /wp-admin?

Also, please note it is not an option to register an admin-menu-item, because the script shall be loaded as a pop-up, and not be available in the menu.

Thanks in advance for your kind help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:35:12+00:00Added an answer on May 26, 2026 at 5:35 am

    Okay. Because nobody seems to have an idea on how to deal with this, I just misused admin-ajax.php as wrapper script for my admin-script. It’s not a very beautiful solution, but it works.

    Please note some functions don’t work as expected when used in AJAX mode, such as wp_die. If anyone has to deal with the same problem: You will need to rewrite these functions to also work in AJAX-mode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the download link of wordpress' plugins via bash script directly
I am trying to write a simple Wordpress plugin, which updates a custom field
I'm trying to substring the title which it is called via the method the_title()
Trying to get Galleria script working in WordPress? I am have enqueued the script
I am developing a wordpress plugin. In this plugin I am trying to get
I've got a WordPress powered blog that I'm trying to get setup on our
WordPress has been installed as a blog into osCommerce. I'm trying to get the
I'm trying to define a new shortcode in WordPress, and I get the following
I am trying to create a Wordpress MU admin plugin, that will insert some
I'm a wordpress newbie trying to add dynamic posts and pages through get requests.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.