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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:20:25+00:00 2026-06-17T09:20:25+00:00

I’m doing a migration from a website to another one which use WordPress. I

  • 0

I’m doing a migration from a website to another one which use WordPress.

I created new custom types for my needs (with the plugin Custom Post Types), and I created categories for each custom type.

I then wrote down a script in Python (adapted from this article), which gets the posts from the db and pushes them remotely on the new (testing) website, using the new WordPress XML-RPC API supported since version 3.4.x.

At the moment I can publish a new post with the correct post type. But if I specify a category, wordpress always returns me this error:

xmlrpclib.Fault: <Fault 401: 'Sorry, one of the given taxonomies is not supported by the post type.'>

I’m sure that the post type is supported by the given taxonomy. I think I’m using a wrong syntax to specify the category id. Here’s the code:

import datetime, xmlrpclib, MySQLdb

def post_remotely(post_data):

    wp_url = "[my wordpress blog url]"
    wp_username = "[myuser]"
    wp_password = "[mypasswd]"
    wp_blogid = "0"

    status = 'publish'

    server = xmlrpclib.ServerProxy(wp_url)

    data = { 'post_title': post_data['title'], 'post_content': post_data['content'], 
             'post_date': post_data['data'], 'post_type': post_data['post_type'], 'terms': post_data['categories'], 
             'post_status': status  }

    post_id = server.wp.newPost(wp_blogid, wp_username, wp_password, data)

    return post_id

And on the caller, to specify the category:

new_post['categories'] = [ { 'term_id': 3, 'taxonomy': 'news-cat' } ]

“news-cat” is the name of the taxonomy associated to the custom type “news”. “term-id” is the id of the category, which I found out using phpMyAdmin.

I’ve also tried other approaches but to no avail. Without the category it works nicely.

Thanks in advance for any help 🙂

  • 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-17T09:20:26+00:00Added an answer on June 17, 2026 at 9:20 am

    XML-RPC WordPress API Document says:

    struct terms: Taxonomy names as keys, array of term IDs as values.
    struct terms_names: Taxonomy names as keys, array of term names as values.
    

    This means terms and terms_names are directory, the key name is the name of taxonomy you want, and the value is an array list.

    If you want to set a category, you should set

    ‘terms‘:{‘my-category’:[4]} 
    

    or

    ‘terms_names’:{‘my-category’:["Wordpress"]} 
    

    in the post structure, where “my-category” is the name of your taxonomy.

    Some information from:解决Python发布wordpress内容返回抱歉,文章类型不支持您的分类法.错误

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am confused How to use looping for Json response Array in another Array.
I want use html5's new tag to play a wav file (currently only supported
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am doing a simple coin flipping experiment for class that involves flipping a
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

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.