• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • Presentations and Interviews
    • on GitHub →
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • WordPress Plugins

Stephanie Leary

Writer, Front End Developer, former WordPress consultant

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

New WordPress plugin: Citation Importer

August 19, 2016 Stephanie Leary 2 Comments

The WordPress Citation Importer plugin imports individual citations, bibliography lists, or lists of DOIs into WordPress via the CrossRef Metadata API. Using a publication post type and/or a few custom fields, you could build a local database of publications for your company, university, library, etc. without having to manually enter each field.

How it works

1. Enter citations into the editor and select which post type should be the destination.

WordPress Citation Importer screen 1: text entry

2. See if crossref.org‘s API found the correct publication(s). (The importer returns only the first match for each citation.) If not, you can run your own search to find the correct DOIs and enter them into the previous screen.

WordPress Citation Importer screen 2: confirm search matches to import

WordPress Citation Importer screen 3: review imported posts

3. Edit the imported data as needed. It will not be refreshed from crossref.org again after the initial import, so your corrections here will stick.

Editing the imported publication

Filters

Your WordPress custom fields and taxonomies likely do not match those used by this importer. Therefore, the post fields, custom fields, and taxonomies are all filterable.

Post fields

Standard post fields (post_title, post_content, post_status, etc.) are stored in the $post array. The original data received from crossref.org is passed to you in the $item object.

apply_filters( 'citation_importer_postdata', $post, $item );

Custom fields

Custom fields are given in the $fields associative array, with the meta_key used as the array key and the meta_value as the value. The $post array contains the standard post fields, and the $item object contains the crossref.org data.

apply_filters( 'citation_importer_fielddata', $fields, $post, $item );

Taxonomies

Custom taxonomies are set in the $terms associative array, with the taxonomy name used as the array key and the term slug (or array of slugs) as the value. The $post array contains the standard post fields, and the $item object contains the crossref.org data.

apply_filters( 'citation_importer_termdata', $terms, $post, $item );

Example Filter Function

Here’s an example of a function that splits the source publication’s volume and issue into separate fields (instead of appending them to the title) and adds a field for the page numbers.

https://gist.github.com/sillybean/5ff713797644043a9546c850011ecc77

Running the importer with the above plugin activated (and the new fields defined in ACF), the publication pictured above now looks like this:

Screenshot of a WordPress editing screen showing the new, separate fields for the publication's volume, issue, and page numbers

You could use the filters to split the authors into separate fields, access the various parsed dates, or import more data from the search results (like the ISSN or alternative ID). Visit any record on crossref.org and view its data as JSON to see all the available fields.

More about CrossRef

The CrossRef Metadata API is an amazing tool for matching formatted citations with their parsed equivalents in a central database.

CrossRef’s Metadata API does not yet include abstracts. You may be able to locate them fairly easily with the DOIs in hand; see this GitHub issue for details. When abstracts become available in the API’s response, they will be added to the plugin’s post data.

Download, donate, contribute

This plugin is available for download on wordpress.org, but it’s also a work in progress, and you can contribute on GitHub.

Want to fund further development? Donate via PayPal.

WordPress citation importer, crossref, import

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2025 Stephanie Leary · Contact