if I want to add access to the db on the wp site.. i know its must simpler to use the $wpdb global.. does this allow you to access a site without including the wp_load.php file in the root.. I assume if you have activated wp it probably will be fine.. but i am guessing if you are not running wp then you may have to load that as a min.. does anyone know aboaut that. I have tried this and even when runing via a wp page it still requires wp-load.php is this normal.


I used global $wpdb; all the time, and never had to use wp-load.php. However, maybe if you clarify your question, it would be easier to know what you want for a better answer.


Manually including wp-load.php is a technique for making WP functions available to scripts that are not run as part of the WP runtime.

If your script runs within the context of WP (a plugin or theme file) you don't need to include wp-load.php because it's already included by wp-blog-header.php which is itself included by the index.php in the root of your site.

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.