The WordPress Citation Importer plugin imports individual citations, bibliography lists, or lists of DOIs into a WordPress publication database (a publication post type with a few custom fields).
1. Enter citations into the editor and select which post type should be the destination.
2. See if crossref.org‘s API found the correct publication(s). If not, you can run your own search to find the correct DOIs and enter them into the previous screen.
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.
This plugin is available for download on wordpress.org, but it’s also a work in progress. Contribute on GitHub→
Want to fund further development? Donate via PayPal.
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, the publication pictured above now looks like this:
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.