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 8970057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:40:47+00:00 2026-06-15T17:40:47+00:00

I am posting to wordpress using below code <?php require(class-IXR.php); $client = new IXR_Client(‘http://domain.com/xmlrpc.php’);

  • 0

I am posting to wordpress using below code

   <?php
            require("class-IXR.php");  
            $client = new IXR_Client('http://domain.com/xmlrpc.php');

            $USER = 'user';
            $PASS = 'pass';

            $content['title'] = 'Test title';
            $content['categories'] = array("games");
            $content['description'] = '<p>Lorem ipsum dolor sit amet</p>';
            $content['custom_fields'] = array( array('key' => 'my_custom_fied','value'=>'yes') );
            $content['mt_keywords'] = array('foo','bar');

            if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true))
            {
                die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());  
            }
            $ID =  $client->getResponse();

            if($ID)
            {
                echo 'Post published with ID:#'.$ID;
            }

    ?>

How can i avoid posting duplicate title.For example if i already have post with title Test it . When i try to post another post with title Test it it should not post.

P.s : I have 1000’s of post in my blog.

  • 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-06-15T17:40:48+00:00Added an answer on June 15, 2026 at 5:40 pm
    if (is_null(get_page_by_title( $content['title'], OBJECT, 'post'))) {
    
    // Do your stuff in this case (no post with the same title)
    
    }
    
    else {
    
    // Do not create post
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am posting to wordpress in java using xmlrpc successfully using the following code
I'm trying to post to WordPress using curl via PHP - I'm posting using
Following the advice in this posting: php class as a plugin in wordpress I've
I am using wordpress CMS and when i am post a new post by
I've implemented a singleton CoreLocation class (courtesy of this link: http://jinru.wordpress.com/2010/08/15/singletons-in-objective-c-an-example-of-cllocationmanager/ ) However, I
I'm posting on Wordpress using the XMLRPC Api from Redstone . Although the post
in this posting http://www.badlogicgames.com/wordpress/?p=504 Mr. libgdx Mario writes: OpenGL from the ground up: an
My wordpress plugin sends data as postrequest using WP_HTTP class of wordpress . $myreq
i'm developing a website through wordpress source code. I'm using a child theme for
Can anyone recommend an xml rpc library or client for wordpress using java? I've

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.