Home Forums ACF PRO Creating a searchable 'database' from excel sheet


Creating a searchable 'database' from excel sheet

  • Hi there,

    I have a rather large excel sheet (800k+ rows) that I would like to import into a WordPress site and provide a simple frontend search.

    I have used ACF in the past on projects with success and could do with a bit of advice as to whether it (perhaps with taxonomies) would be suitable…

    The crux of the project is to allow the user to view information on a company and the suppliers they use.

    For example, columns in the spreadsheet contain; a restaurants name, year established, their location, their cuisine speciality, and a produce supplier.

    The rows are then repeated where there is more than one supplier.

    Would any kind soul have any suggestions as to how best achieve this?

    Ideally the user would search for a restaurant and the full result would then detail the fields outlined above. Similarly, if the supplier could be clicked and a list of the restaurants could be provided, that would be great.

    As always, any assistance hugely appreciated.


  • Hi @tjm1987

    I suggest you add both restaurant and supplier as custom post types and then use the post object field or the relationship field to create the connection/relationship. With relationship field, you can query them by following this article: But I believe you can do it by using the post object field too.

    I hope this helps 🙂

  • Thanks James, that’s great – I’ll let you know how I get on!

  • This reply has been marked as private.
  • Hi James,

    Think some progress – would you (or anyone else) have any recommendations as to how to best batch import? 800k rows, or so!

    My concern would be the creation of duplicate posts though for Restaurants and/or Suppliers.

    My CSV is structured as follows;

    1) Restaurant Name 2) Supplier 3) Country 4) Region 5) Speciality 6) Speciality Sub-section

    Each row is repeated where there is a unique record, so for some restaurants, I end up with multiple instances of the same.

    Ultimately, I would like to establish the relationship Restaurant <–> Supplier and then filter using the other fields.

    Not sure if a clever use of taxonomies is the right way forward or not? But initially I’ve got 1 & 2 as post types, with the rest as custom fields and another (relationship) custom field for each CPT.

    Could e-mail over a sample of the data if that would help?

    Thanks thus far and in advance – appreciate this is my own headache to solve!

  • Hi @tjm1987

    I think you need to check if a restaurant post with the same title exists or not (I believe the restaurant and supplier name are unique ). If it does, then check if a supplier post with the same title exists or not. If the supplier exists, get the ID and update the relationship. If not, create a new supplier first.

    I hope this makes sense 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.