[wp-pro] Re: wp-pro Digest, Vol 33, Issue 13

Scot Hacker shacker at berkeley.edu
Tue Mar 18 18:09:02 GMT 2008


On Mar 18, 2008, at 5:00 AM, Scot Hacker wrote:

> Create a script that lives inside a theme folder and that includes the
> WP header (like you would find near the top of index.php):
>
> <?php
> get_header();
> ?>
>
> then gather up your title, content, etc. vars and pass them to the
> wp_insert_post function:
> http://codex.wordpress.org/Function_Reference/wp_insert_post
>
> Then run your script from the command line from the theme dir.

I should add that you would not want to leave a script like that in  
place permanently on a production server. Presumably you would do this  
only on your development server, and would remove it once your import  
work is done. You wouldn't want a bad guy finding the script URL and  
populating your database...

./s



More information about the wp-pro mailing list