• Wondering if someone can help me automatically import an RSS feed as a WordPress blog post? The RSS feed updates everyday and I am not importing just a static file.

Viewing 1 replies (of 1 total)
  • create a script which will get the contents of the RSS feed and store in a variable. from that variable, using regular expression, separate the title and store it in a variable(suppose $title) and the content in another variable(suppose $content).

    then you have to call the wp_insert_post and pass $title and $content to the function which in turn will return $postid.

    Finally you can run this script using cron tab.

    In this way you can add tags also. please refer https://codex.www.ads-software.com/Function_Reference/wp_insert_post for more detailed information.

    N.B: one more trick. if you want to stop duplicate posting, then in wp-includes/post.php, find suffix=2. just before that line add ‘return 0’. this is for WP 2.7.1. for latest version you have to dig into the code. I havent updated WP yet.

Viewing 1 replies (of 1 total)
  • The topic ‘How Can I Automatically import an RSS feed as a WordPress blog post?’ is closed to new replies.