Here is a simple method that you can use to import news, posts or content from a text file into WordPress. This script assumes the text data file has each post on a separate line with fields separated by a |. This is how most flat file news scripts store data. It also uses the php tidy extension to clean the input before inserting into the database. If you need to import data from a different source, all you need to do is include the wp-load.php script and use wp_insert_post to insert post.

Copy to Clipboard
Published On: December 27th, 2024 / Categories: Wordpress /