I am in a situation where I need to use data from an API (XML) served by a third party in my WordPress site. The data will be updated on that third party application.

Specifically this is data about properties that is stored on said 3rd party web application. The data is made available in XML format. I would like to allow displaying of this data in a WP website, as well as searching, and eventual portal to said application for booking.

At the moment I have three options, and I would like to know if one is preferred over the others.

Option 1:

Store an xml with all data as using transient API in WordPress and access the data using Ajax in a post template

Option 2:

Store an xml with all data as using transient API in WordPress and access the data using php in a post template

Option 3:

Importing the data into the WP database as custom posts and associated metadata?

The data is only available as an XML format (which is why I mention it).

My specific worries are that not having the data stored in WP database might lead to inability to search/sort data using WP functions.

I am just beginning development of a plugin now, and the decision as to how to utilise the data will dictate the direction of development.

  • 1
    probably too broad. You need to store some data that needs to be accessed in some way..... It is hard to give a specific answer to such a broad question. Nov 21, 2015 at 11:20
  • Hi Mark, thanks for taking the time to comment. I disagree that the question is as broad as you imply, but I will try to clarify in the question. Nov 22, 2015 at 15:29

1 Answer 1


The way you are going about it is wrong. The source of data should not be relevant to how you store it in the DB. If the fact that this is a 3rd party service that supplies the data in some buzzword format confuses you, maybe you should try to imagine the input as coming from a low paid student doing a daily data input and how would you have built the DB then.

  • Hi Mark, Apologies but I don't think this is an answer to the question. I am not asking "how" to store it in the database - I have some options, but I would like to find out if there is a preferred option. I am not confused by any "buzzwords" either, and I know where the data will be input (3rd party) and the http request will always be GET and not POSTed from the WP website (so data input, be it from a low paid student or an octagenerian is of no relevance). Nov 22, 2015 at 15:47
  • You can't make design decisions without having a use case. If it is properties that needs to be displayed then CPT is a must but if you just need to compare some values against the XML then maybe you can leave it as it is. The confusion I am talking about is not because of lack of knowledge or ability, but because of focusing on the wrong things maybe because you think they are the important part of the project. In most web project design of data strorage is something that you do only after all the other aspect of the project are designed. And maybe they are here but you omitted the details. Nov 22, 2015 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.