Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:42:19+00:00 2026-05-14T04:42:19+00:00

Im using WordPress, Im also creating posts via XMLRPC based on an RSS feed

  • 0

Im using WordPress, Im also creating posts via XMLRPC based on an RSS feed that is added to periodically.

What I want is to read all post titles, compare those against the RSS feed, then only post to WordPress where the post titles dont exist.

I’m trying this code:

<?php
define('WP_USE_THEMES', false);
require('../wp-load.php');
query_posts('showposts=-1&author=1&post_status=publish');
?>

<?php while (have_posts()): the_post(); ?>

<?php the_title(); ?>

<?php endwhile; ?>

This gets all titles from published posts, I then need to do the same to get the draft posts.

I need to write these title’s to an array?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:42:19+00:00Added an answer on May 14, 2026 at 4:42 am

    It will be more efficient to write your own query to retrieve just the post titles rather than using query_posts. Something like this should work:

    $titles = $wpdb->get_col(
        "SELECT post_title
        FROM $wpdb->posts
        WHERE post_type = 'post'
        AND post_author = 1 
        AND post_status IN ('publish', 'draft')"
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using wordpress, I am pulling in a custom fields from specific posts to fill
1) I'm using WordPress as a CMS for a site. Therefore I want to
I do a lot of tutorials using Wordpress. The main characteristic thing is that
I'm aware that the wordpress API can be used to make posts to wordpress
I am creating a WordPress site using Artisteer and various plugins to show off
I am using wordpress for my website like a CMS, also have installed ALL
I've created a mobile app based on the jquery mobile framework. I'm using wordpress
My Goal I want to modify wordpress project as per my needs. I also
Using Wordpress.. I would like to redirect to a certain page on the site
Im using wordpress for my website and i have a massive amount of data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.