Using WordPress core externally

Using WordPress Core externally can be quite useful when wanting to utilize WordPress functions from within another project/app. I’m setting up a cron job at server level, but I wanted to be able to leverage WordPress functionality. Because of how WP Cron works (initiated on page load, not time), I wanted to separate my cron process from the WordPress installation.

After a little digging around, I found this thread on StackExchange. It explains the setting up how to access WordPress core externally.

The following code will allow you to use all WordPress Core functionality!

{code type=php}
Test it

{code type=php}
if( function_exists( ‘update_option’ ) )
echo ‘We have WordPress support’;
echo ‘no WordPress support’;

Use WordPress core externally!

Now that you have access to WordPress core functionality, the limit is the sky! (or at least the latest version of WordPress).

2 thoughts on “Using WordPress core externally”

  1. I’m not sure if this will get munged by any parsers, but your first code snippet doesn’t look like it’d work.

    <!–?php // All that is required to bootstrap into WordPress.

    should be

    // All that is required to bootstrap into WordPress.

Comments are closed.