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

I'm starting a new service for a customer consisting in adding a input API in their WP website. I started by creating a blank page on the root but then I realized I couldn't access all methods and function to insert datas in WP. Basically I need to insert strings and integers as custom post types and meta datas.

What would be the best way to make default functions and methods accessible in my script?


share|improve this question
up vote 1 down vote accepted

Put this code in the top of your api page, it will call in the functions, but you need to tell wordpress NOT to try and draw a page as well

define('WP_USE_THEMES', false); // Tell wordpress not to draw out a page
require('/path/to/public_html/wp-load.php'); // load wordpress functions
share|improve this answer
That's exactly what I was expecting! Thanks – Kaaviar Jan 6 '12 at 12:24

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.