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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:21:43+00:00 2026-06-13T08:21:43+00:00

I am working with wordpress xmlrpc javascript api , a neat javascript api for

  • 0

I am working with wordpress xmlrpc javascript api, a neat javascript api for accessing wordpress’s xmlrpc api from javascript.

The problem I have is, after wp.editPost returns true, the post content is simply blank!

This is my relevant code:

var wp = new WordPress(blog, username, password);
var blogId = 1;
var object = wp.getPost(blogId, postId);
// alert(JSON.stringify(object));
var currentContent = object.post_content;
alert(currentContent); // works fine
var newContent = currentContent.replace('</ul>', strToInsert + '</ul>')
alert(newContent); // works, and it is what I want the content to be after editing
object = wp.editPost(blogId, postId, {post_content:newContent});
alert(JSON.stringify(object)); // works, alerts true

Now, refreshing my page, the changes do not take place, but instead my content becomes empty now.

empty content

Any idea what is wrong? I am sure it has to be something with wordpress. I could look into it but I was wondering if any of you had similar problem too!

Note: I refresh the page while I was logged in. Does this matter anyhow?

  • 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-13T08:21:44+00:00Added an answer on June 13, 2026 at 8:21 am

    Well, the problem, was with newContent. It was html, and wordpress didn’t like it. I solved it after numerous attempts by escaping newContent before it is sent, using this SO answer’s code. And, it works now.

    Thanks to @Anentropic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on wordpress template where div.post-thumb is empty but have dynamic white spaces.
I am working with wordpress and I have to display a menu based on
I am working on wordpress and I have to add a metabox in case
I am working on a WordPress site and I have placed the following code
I'm working on a wordpress site, with a blog post that ends like: http://www.blog.com/?p=2
note: I'm working on wordpress but this isn't a wordpress question. I have a
So I have been working with Wordpress 3.x and trying to build a custom
I'm working on a wordpress plugin, and have come across a barrier of sorts.
Im working with wordpress and this function im using returns this or something that
I'm working on wordpress plugin, which handles shopping cart. I have two pages, checkout

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.