/ Blog / Tutorials / Streamline ACF Data Export in Just 5 Steps

Streamline ACF Data Export in Just 5 Steps

Sep 30, 2024

Custom fields are great for adding structured data to your WordPress posts, pages, and custom post types. And when it comes to custom fields, Advanced Custom Fields (ACF) is the go-to plugin for many WordPress users.

But what happens when you need to export that valuable ACF data? Maybe you’re migrating to a new site, want to use the data with other software, or just need a backup. Unfortunately, neither WordPress nor ACF itself offers a straightforward way to export custom field data.

Don’t worry, though! We’ve got a solution that’ll make exporting your ACF data a breeze. In this article, we’ll show you how to streamline your ACF data export in just five easy steps. 

Choosing the right tools for exporting ACF data

First, you need to understand that there are two possible types of exports in ACF, both of which we’ll cover in more detail: 

  • The custom field groups that you want to use somewhere else – not the data itself, just the definitions of ACF groups. 
  • The field data itself. 

When it comes to exporting ACF data, you’ve got a few options depending on your tech skills and what you want to achieve:

Exporting field groups with ACF 

If you just want to move your field groups to another WordPress site, ACF has you covered. Here’s how:

  1. Go to ACF > Tools in your WordPress dashboard.

    ACF plugin settings
  2. Check the boxes next to the field groups you want to export

    Selecting field groups to export
  3. Click Export File.

  4. To import, return to the same screen, choose your JSON file, and hit Import File.

    Importing a file with custom field groups

Exporting field data

When it comes to exporting the actual ACF data, you have a couple of options. For the tech-savvy folks out there, you can export specific custom field data using phpMyAdmin. But fair warning: this method is for advanced users only!

This is how you can export custom field data using phpMyAdmin:

  1. Log in to your hosting control panel (e.g., cPanel) and open phpMyAdmin.

  2. Select the database that your WordPress site is using from the left sidebar.

    Accessing the WordPress database in phpMyAdmin.
  3. Find and click on the wp_postmeta table. Note that the table prefix wp_ might be different depending on your WordPress setup.

  4. Click on the SQL tab in phpMyAdmin.

    Opening the SQL tab for the wp_postmeta table.
  5. For this tutorial, we have a custom checkbox set up in the WooCmmerce product edit page with the label “Only in stores”. We want to export the ID and mta_key of the products with this checkbox ticked. To do this, we’ll run the following SQL query:

    SELECT pm.post_id, pm.meta_key, pm.meta_value
    FROM wp_postmeta pm
    JOIN wp_posts p ON pm.post_id = p.ID
    WHERE pm.meta_key = ‘_only_in_stores’ AND p.post_type = ‘product’;

    Query breakdown:

    • SELECT pm.post_id, pm.meta_key, pm.meta_value selects the post_id, meta_key, meta_value columns from the wp_postmeta table.
    • ROM wp_postmeta pm JOIN wp_posts p ON pm.post_id = p.ID joins the wp_postmeta table with the wp_posts table to ensure you’re only selecting meta fields that are associated with products.
    • WHERE pm.meta_key = ‘_only_in_stores’ AND p.post_type = ‘product’ filters the results to include only the rows where the meta_key is ‘_only_in_stores and the post type is product.

    This is only an example. Your query might be different depending on the data you’re exporting. For example, to export data for a different post type (e.g., posts, pages), modify the post_type condition.

  6. After running the query, phpMyAdmin will display the results. Verify that this is the data you want to export, then scroll to the bottom of the results page and click on the Export button

    Exporting custom field data using phpMyAdmin.
  7. Choose the desired export format (e.g., CSV, SQL, etc.).

    Choosing the desired format for the export file.
  8. Click on Go to download the export file.

This approach requires you to know the meta key of the field in which you’re exporting the data; otherwise, it will not work.

Admin Columns – A powerful alternative

If you want to make your life easier (and who doesn’t?), a plugin like Admin Columns is your best bet for exporting and managing ACF data.

Let’s talk about why Admin Columns is such a great tool for handling your ACF data:

  • Powerful CSV export: You can export your custom field data to a handy CSV file right from the list table. You’re in control of which fields and data types to include and how they’re organized.

    Admin Columns' CSV export function.
  • Exported CSV file example
  • Advanced data segmentation: Filter your posts, pages, and custom post types by pretty much any data type, including custom field data. Add as many filters as you need for super-specific data segmentation, and save your favorite filters for quick access later.

    Adding filters to custom fields
  • Saving a filtered segment with Admin Columns
  • Streamlined data management: Customize your list table views to show only the data you care about. Add, remove, and tweak columns, including tons of dedicated columns for ACF and other popular custom field plugins. You can even create different table views for different purposes or users and switch between them with a single click.

    Different list table views
  • Easy data updates: Update custom field data entries right from the list table. Use the inline edit function for quick individual changes, or the bulk edit function when you need to update multiple entries at once.

    Inline editing a custom field
  • Bulk editing custom field columns

Step-by-step guide: Exporting ACF data with Admin Columns

Ready to export your ACF data? Let’s walk through it step by step:

  1. Head to your desired list table (like Posts) and click on the Admin Columns icon to open the column settings.

    Accessing the Admin Columns settings for Posts
  2. Add custom columns for the ACF fields you want to export, save your changes, and go back to the list table.

    Adding a custom field column from Advanced Custom Fields
  3. Use the column headers to sort your data.

    Sorting a custom column in descending order
  4. Add filters based on your ACF fields. Combine multiple filters to get exactly the data segment you need.

    Adding filters to a list table with Admin Columns.
  5. Use inline editing to tweak individual entries.

    Inline editing a custom field with Admin Columns
  6. For multiple updates, use bulk editing to save time.

    Bulk editing data with Admin Columns
  7. With your data sorted and filtered, click the “Export” button.

    Export button in Admin Columns
  8. Choose which columns to include in your export.

    Choosing which columns to export
  9. Hit “Export” again, and you’re done!

Open the CSV file to verify everything looks good. Now you can use this data for backups, analysis in spreadsheet software, or importing into other systems!

Optimize your ACF exports with Admin Columns

There are lots of reasons you might need to export your ACF data – from creating backups to moving data between sites or analyzing it in other tools. While ACF itself lets you export field groups, it doesn’t give you a way to export the actual custom field data.

That’s where Admin Columns comes in. It not only makes exporting your ACF data a cinch but also gives you powerful tools for managing and updating that data right in your WordPress admin.Ready to make your ACF data management a whole lot easier? Get started with Admin Columns today and see the difference for yourself!

Get Admin Columns Pro

Effortlessly sort, filter, edit, export, and organize content in the WordPress admin.

$ 79 / year