Karl Herrick

A technologist and web developer | Posts about technology encountered along the journey.

Post via script

I just whipped up some PHP and threw it in the root of a brand new WordPress 2.9.2 install:


$my_post = array();
$my_post['post_title'] = 'My post';
$my_post['post_content'] = 'This is my post.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;

wp_insert_post( $my_post );

Voila. The post appeared when navigating to the .php file.

See: http://codex.wordpress.org/Function_Reference/wp_insert_post.

For more creativity, get into the database: http://codex.wordpress.org/Function_Reference/wpdb_Class