DK WC Books Docs

Welcome to the DK WC Books Docs page. Use these sections to set up WooCommerce book products, import and manage Book records, configure display settings, and add Books pages, cards, or Book Displays to the site. If you're still unable to find the help you need or would like to request a new feature or setting, please email me.
WooCommerce Product Setup
Managing Book Records
Default Settings
Archive and Book Displays
Displaying Books
Editing a Book Record

WooCommerce Product Setup

DK WC Books builds public Book pages from WooCommerce products. Before importing, make sure the products use the categories and attributes configured for Books in the DK Base Plugin settings.

Only products assigned to the configured Book product categories are imported. The WooCommerce product remains the source for price, purchase options, product image, description, stock status, gallery images, and format data.

Screenshot of Products list.

Required Product Structure

For the initial import, WooCommerce products that should be grouped into one Book record must use the same product title. For example, eBook and paperback bundles of the same collection can share a title during import.

After import, the Book record stores the linked product IDs. Product titles can then change without breaking or moving the relationship, and products with different titles can be added explicitly from the Book editor.

Different formats can be represented by separate products, product attributes, or variations, depending on how the item is sold.

Collections such as boxed sets, trilogies, or omnibus editions can be identified with the Collection attribute so archive sections and public displays can separate them from single-title books.

Product Attributes

Create product attributes under Products -> Attributes, then apply the correct terms to each WooCommerce product from the product edit screen.

  • Format: Used for purchase format options such as eBook, paperback, hardcover, audiobook, or signed paperback.
  • Collection: Marks boxed sets, bundles, trilogies, omnibuses, or other multi-title products.
  • Book Author: Used for author display and archive filtering when configured.
  • Genre: Used for book details and optional archive sections.
  • Narrator: Used for audiobook details when available.
  • Series: Used by DK Book Series and by Book archive sections when configured.
  • Series Number: Used for display values such as Book 1, Prequel, or 1 of 5.
  • Language: Used by the archive language filter when configured.
Screenshot of Product Attributes list.

Before Importing

Confirm that each product has the correct Book category, product image, price, stock status, format details, and any attributes needed for the Book page or archive layout.

If the book has multiple products, use the same title to group them automatically during import, or link them later from the Book editor. Product-specific details such as pages, runtime, dimensions, or ISBN values can be maintained on the WooCommerce product for other DK display plugins to use.

Edit Retailers

Use Edit Retailers on the Books list to manage the retailer directory independently of product attributes. Edit names and retailer website URLs, choose a bundled logo or a Media Library image, select supported formats from the configured Book Format Attribute, and check Library for library services. The directory starts alphabetically; click column headers to sort the view without changing the Main Retailers display order. Website defaults are supplied where confirmed. Use Default removes the Media image override.

Amazon, Apple Books, Google Play, Barnes & Noble, Spotify, and Audible start as main retailers. Select Main Retailer on the Retailers tab, then use the Main Retailers tab to drag those stores into order or move them with the up and down buttons. Only enabled main retailers appear in the ordering list.

Search the Retailers and Disabled tabs by name. Counts show matching records, records in the current view, and the total directory size. Disable a retailer to retain its details while excluding it from the active list. Use Enable on the Disabled tab to restore it. Save Retailers saves every record, including records hidden by a search or another tab.

The directory is stored in the WordPress database. Bundled defaults initialize it only once, so later edits and disabled retailers are preserved.

Managing Book Records

The Books list is where imported Book records are reviewed, edited, sorted, copied, and maintained. Each Book record represents the public page or card used to display one grouped set of WooCommerce book products.

Import Books from WooCommerce

The Import Products button opens a review screen for WooCommerce products that meet the category and product-status rules on the Import Settings page. Products already assigned to a Book are excluded.

Auto Import previews every proposed change before it runs. Unassigned products with the same title are grouped into one new Book. When enabled in Import Settings, an exact-title match can instead attach those products to a single existing Book. Duplicate Book titles are held for manual review.

Manual Import lists every eligible unassigned product separately. Use it to add a product to a selected existing Book or create a new Book using that product's title. It does not move products already linked to another Book.

Review imported records before publishing to confirm the linked products, primary product, page styling, samples, retailer links, additional content, and review settings.

Edit Import Settings

The Edit Import Settings button controls eligible product categories and statuses, whether selected categories include their descendants, the status assigned to newly created Book records, and whether Auto Import may attach products to a single existing exact-title Book.

If no categories or no product statuses are selected, no products are eligible. Changing these rules does not remove products already linked to a Book.

Bulk Actions

Apply Default Settings replaces the selected Book records' display settings with the current Default Settings. The Book title, linked products, primary product, audio sample, epub sample, retailer links, additional content, and reviews are preserved.

Move to Trash sends the selected Book records to the trash.

Screenshot of Bulk Actions dropdown list.

Edit Default Settings

The Edit Default Settings button opens the settings used as the starting point for new imports and as the source values for Apply Default Settings.

Update defaults before importing a large batch or before applying defaults in bulk.

Edit Archive Settings

The Edit Archive Settings button opens the global settings for the public Books archive page. These settings control the archive title, page styling, container styling, tab styling, and Section Data layout used by the main Books archive.

Edit Book Displays

The Edit Book Displays button opens reusable Book Display records. Each Book Display has its own Section Data and style settings and provides a shortcode that can be placed on another page or post.

Page URL

The Page URL column provides the public Book page link. Click the icon to copy it.

Shortcode

The Shortcode column provides a Book card shortcode for the record. Click the icon to copy it.

Use the Displaying Books tab for available shortcode parameters.

Books List Sorting

The icon can be used to drag Book records into the desired order where custom ordering is supported. Sorting the Books list can also affect store content when DK WC Store uses this plugin's order.

Main retailers and display settings

Edit Retailers for Books is a global directory. Its Main Retailers tab controls the main retailer order and Group Main Retailers by Format. Grouping starts unchecked. When unchecked, choose a Display Format from each retailer's supported formats; checking grouping preserves that choice.

The bundled directory contains 47 default retailers and library services, each with a named 150 by 50 PNG logo. Directory updates do not remove entries from an existing saved list. Disable unwanted entries in Edit Retailers, or use a retailer JSON entry with action set to remove to delete one during import.

The Display Settings tab contains All Links Text and All Links Button Text. The defaults are Looking for more places to buy or borrow this book? and All Retailer Links. These settings apply across Books, not just to Books2Read.

Migrate links across all Books

Open Migrate Retail Links Across All Books from the retailer directory. Review original custom links, Amazon ASIN/ISBN values, and Audible links together. Search or filter the list, select records, match a retailer and format, then choose Migrate Selected Links. Bulk choices can be applied to selected rows. Choose Remove as the retailer to discard an original link without selecting a format.

Unselected original links stay in use. Migration keeps an original-link backup for each affected Book. A site-wide completion flag is set only after no pending original links remain; it controls removal of the obsolete migration controls and legacy fields. Empty Amazon and Audible legacy fields are omitted.

Retailer Import / Export

Use Import / Export Retailer Data on Edit Retailers for Books. The Export tab downloads one versioned JSON file for the retailer directory, configured formats, and existing Books, including Books with no retailer links. Browser export and snapshot filenames include the site domain and any site subdirectory so downloads from different sites are easy to distinguish. Skip Bundle Products, Skip Private Products, and Skip Draft Products are separate checkboxes, checked by default on the Export tab. Uncheck each filter independently to include those products. Product status filters also check variable parents and individual variations; they do not filter by Book status. Books linked only to excluded products are omitted; Books without products remain included. The Import tab accepts a file up to 5 MB or pasted JSON.

Identity and matching

Keep existing retailer IDs unchanged. Exported retailer rows are alphabetical. The order number controls saved retailer order; changing only the file row order does not reorder retailers. Books receive persistent UUIDs on the first export or preview; cloned Book records receive separate IDs. Use the UUID for updates, or an exact existing Book slug for a newly added file entry. Unknown UUIDs may fall back to an unambiguous slug, with a preview warning. Numeric WordPress IDs are reference information, not matching keys. No Book records, products, or format terms are created.

Format references use the slugs in formats. Book titles, author and language listed once per Book, available format SKUs and identifiers, and original legacy_links provide context for reviewing or searching for listings. They are not imported as Book or product edits. Original legacy links must first be handled by the migration tool.

Each products row contains its own sku and format slug, an is_bundle flag, and identifiers or review_reasons only when present. Author and language are stored once per Book; genre, repeated attributes, product titles, and product IDs are omitted. Variable parent SKUs are not used. Out-of-stock variations are included. Missing SKUs and missing or ambiguous formats are listed in review_reasons; no SKU is invented or copied from the parent. Product data is reference-only and is not imported as catalog edits.

Skip Bundle Products excludes bundle products and Books linked only to bundles from the download. Books with standalone products remain included. When included, bundles have is_bundle true. Bundle plugin types, Bundle/Bundles product categories (including their subcategories), and bundle format slugs are recognized. link_check_policy.skip_bundle_products records the export choice for future checking and searching tools. Skip only the bundle product, not standalone products linked to the same Book. This policy is an instruction for the external task, not a saved WordPress setting; the export checkbox starts checked. Internal pre-import snapshots always include bundles. Disabled retailers must always be skipped.

Add, update, disable, or remove

Use action upsert to add or update a retailer or a retailer/format link. A new retailer needs a unique lowercase text ID and a name. supported_formats and display_format use format slugs. The export fills logo with the effective bundled key, including automatic defaults, and image_url with the effective bundled image or original Media image URL. The logo key controls bundled images, whose URLs are recognized across sites without downloading them. Media overrides must identify an image already in this site Media Library. Retailers without a brand image retain empty values.

Omitting a record or link leaves it unchanged. Use action remove explicitly to delete a link. If its URL is included, it must match the saved URL. A retailer can be removed only when its links have also been explicitly removed; otherwise use disabled true. Disabled retailers and their links remain exported but must be skipped by link-checking and link-searching automation.

A Book may have one URL per retailer and format. Amazon accepts either a full URL or an ASIN/ISBN-10; identifiers become full URLs on save. The importer never adds the global Associate ID to stored URLs and preserves tags already in URLs. Display Settings, including grouping and all-links text, are not exported or imported. Imports leave these site settings unchanged even if the JSON includes display_settings. The global Amazon Associate ID is not imported.

Preview, pending review, and snapshots

Preview the entire file before selecting Import These Changes. Validation errors stop the import. A preview is tied to the signed-in user, expires after 30 minutes, and cannot apply after managed data changes. Unchanged files produce no changes. The importer saves a pre-import snapshot and recovers attempted writes if a save fails, including on older nontransactional database tables.

Set status to pending_review on a retailer, Book entry, or link and optionally supply review_reason. The preview reports and skips those entries without replacing existing data. This phase does not check live URLs, search retailers, save a separate review queue, send email, or schedule a weekly task.

The five most recent pre-import snapshots can be downloaded from the Import tab by administrators. Importing a snapshot follows the same merge rules: it restores supplied earlier values, while later additions remain unless you explicitly remove them.

Command line

wp dk-books retailers export /private/path/retailers.json
wp dk-books retailers import /private/path/retailers.json --dry-run
wp dk-books retailers import /private/path/retailers.json --yes

CLI exports skip bundles, private products, and draft products by default. Use --include-bundles, --include-private, or --include-drafts independently to include them. Use --force to overwrite an existing export file. CLI imports use the same validation, explicit-removal rules, pending-entry handling, snapshots, and stale-data checks as the admin importer. These commands are available for manual testing now; no automation is installed.

Default Settings

The Default Settings page controls the starting style and global values used by Book records. Defaults are applied during import and can also be applied later from the Books list page.

Most display settings can be overridden on an individual Book record. Global values, such as the page slug and Amazon Associate settings, apply across the plugin.

Book Page Settings

  • Page Slug: Sets both the public Books archive URL and the base URL used for individual Book pages.
  • Allow Reviews: Enables Site Reviews output on Book pages when the Site Reviews plugin is installed and active.
  • Page Background Color and Image: Sets the default page background for Book records.

Book Card Settings

Book Card Settings control the default format, title, series text, card background, border, border radius, headings, text, links, and rule colors used by Book pages and card shortcodes.

Use these settings to establish the standard visual style before importing Books or applying defaults in bulk.

Button Settings

Button Settings control the default colors, border colors, hover colors, and border radius for the Audio Sample button, Book Preview button, and Add To Cart button.

Additional Retailer Settings

  • Amazon Associate ID: Adds the current global Associate ID at display time only when an Amazon URL has no tag of its own. The per-Book shortcut edits this same global value.
  • Hide Amazon Associate Message: Hides the Amazon associate disclosure on Book pages when the disclosure is already handled elsewhere on the site.
  • Retailer Icons and Retailer Images: Changes retailer links from text links to supported icon or image treatments.
  • Gallery Images: Displays WooCommerce product gallery images on Book pages when available.

Archive and Book Displays

The Archive Settings page controls the public Books archive. Book Display records use the same setting groups but produce reusable shortcodes that can be placed on other pages or posts.

Both surfaces build book sections from the Section Data editor, which can filter by taxonomy terms and sort the books inside each section.

Global Books Archive

The global Books archive uses the configured Page Slug from Default Settings. Clicking View Books Archive Page opens that public archive in a new browser tab.

Use the Page Settings, Container Settings, and Tabbed Layout Settings tabs to control the archive title, background, content container, number of books per row, and tab colors.

Section Data

Section Data defines the sections visitors see on the archive or display. Add sections for common groupings such as Series, Non-series, Collections, Genre, Language, Format, Author, or Category.

Drag available terms into a section to filter the books shown there. Add sort rules when a section needs a specific order, such as Books Order, Menu Order + Title, Title, Category, Genre, Language, Format, Author, or Collection.

Keep section names visitor-facing. For example, use "Collections" or "Box Sets" rather than an internal taxonomy name.

Book Displays

Book Displays are saved display layouts with their own settings and Section Data. Create them from the Books list page by clicking Edit Book Displays.

After publishing a Book Display, copy the shortcode from the Book Displays list or from the edit screen:

[dk_wc_book_display id="00000"]

  • id: Required. Identifies the Book Display record to render.
  • additional_css_classes: Optional. Adds custom CSS classes to the display wrapper.

Archive Shortcode Alias

The shortcode handler also supports [dk_wc_books_archive id="00000"] as an alias for Book Display output. Use the copied [dk_wc_book_display] shortcode unless you have an existing page that already uses the alias.

Displaying Books

DK WC Books can display books through individual Book pages, the public Books archive, Book Display shortcodes, and individual Book card shortcodes. The output pulls from the Book record, the connected WooCommerce products, and related product attributes.

Individual Book Pages

Each published Book record has its own public page. Book pages can show the product image, title, subtitle, series, purchase formats, Add To Cart button, product gallery, audio sample, epub preview, retailer links, YouTube content, description sections, reviews, Goodreads widget, book details table, upsells, and related products when those values or plugins are available.

The page URL is copied from the Books list page and uses the Page Slug configured in Default Settings.

Books Archive

The public Books archive is generated from Archive Settings. Use Section Data to decide which sections appear and which books each section contains.

The archive can use tabbed sections and can include a language filter when the Language attribute is configured and available in the selected section data.

Book Display Shortcode

Use a Book Display shortcode to place a saved archive-style layout on another page or post:

[dk_wc_book_display id="00000"]

  • id: Required. Identifies the Book Display record to render.
  • additional_css_classes: Adds custom CSS classes to the display wrapper.

Book Card Shortcode

Use a Book card shortcode to display one Book record with its image, title, format selector, and Add To Cart button:

[dk_wc_books_card id="00000"]

  • id: Required. Identifies the Book record to display.
  • use_default_settings: Uses Default Settings instead of the record's own display settings.
  • img_link: Links the book image to the Book page.
  • img_only: Displays only the book image and overrides the buy block.
  • display_buy_block: Shows or hides the format selector and Add To Cart button.
  • additional_css_classes: Adds custom CSS classes to the card wrapper.

Public retailer links

Enabled main retailers appear in their saved directory order only when the Book has a usable link. With grouping enabled, formats have headings and partial separators matching the rule above the all-links section. With grouping off, each retailer uses its selected Display Format when that format has a URL; otherwise it uses the first queried format for which it has a URL.

Original unmigrated links appear before the new main retailer links. Books2Read stays last. If usable links exist beyond the main links currently displayed, All Links Text and the All Retailer Links button appear. If only a Books2Read link remains beyond the main links, the text appears above Books2Read without an all-retailer button.

The all-retailer popup groups links by format, with retailers alphabetically within each group. It includes enabled retailers and available original links; original links without a known format appear in Other Retailer Links. Links open in a new tab. Library services are marked. All default retailers have named 150 by 50 PNG logos. A retailer without a logo uses a name button with matching dimensions, border, shadow, and hover treatment in both the main links and popup.

The default all-links prompt balances wrapped text and has side padding and a partial separator. The popup uses the same shared mouse and keyboard focus behavior as Book Details and EPUB Previewer. Use DK Base Plugin 4.1.1 or later.

Editing a Book Record

The Edit Book Settings page controls the content and styling for a single Book record. Use it after import to finish the public page, card, samples, retailer links, YouTube content, additional sections, and reviews.

Book Page Settings

Book Page Settings control the WooCommerce products linked to the Book, the primary product, and the page background color and image. Removing a linked product here does not delete the WooCommerce product.

The primary product supplies the initial cover, description, and selected purchase option. If it is a variable product, its WooCommerce default variation is selected first.

If DK Book & Format Details Table is installed and active, this tab can also hide the details table for the current Book page.

Book Card Settings

Book Card Settings control the record-specific colors, borders, headings, text, links, rules, and button styles used when this Book appears on its own page or as a shortcode card.

Button Settings

Button Settings control the Audio Sample, Book Preview, and Add To Cart button appearance for this Book record.

  • Audio Sample File: Selects the MP3 sample used on the Book page.
  • Epub Sample File: Selects the epub sample used by the Book Preview button when the DK Epub Previewer shortcode is available.
  • Epub Start Location: Sets the starting point for the epub preview. If no start location is selected, the preview starts at the beginning.

Additional Retailer Settings

The Amazon Associate ID appears first. It is a read-only view of the global setting; use its pencil icon to edit and save it immediately without updating the Book. A change affects Amazon links across all Books that do not specify their own tag.

Custom Retail Links are grouped into collapsible format sections, closed initially with link counts in their headings. Add a retailer and URL under the correct format. Retailer choices are alphabetical and use the directory's supported formats. The Test Link icon opens the current URL in a new tab; the trash icon removes that row. Update the Book to save its links.

For Amazon only, the URL label also allows an ASIN or ISBN-10. Saving builds a full Amazon URL from that value. The global Associate ID is added only on public display, and a tag already supplied in a URL is preserved.

Before site-wide migration is complete, review original links in Migrate Existing Retailer Links. Choose the retailer and format, check Migrate, and update the Book. Remove discards an original link without a format. Unselected original links remain in use. The directory also provides a migration screen covering all Books.

The optional Books2Read Link section is below Custom Retail Links. Field-specific information icons open help on click and keep it visible until you click away.

Additional Content Settings

  • YouTube Video or Playlist URL: Adds a YouTube video or playlist to the Book page.
  • YouTube Thumbnail Override: Selects a Media Library image to use instead of the YouTube-provided thumbnail.
  • Additional Description Text: Adds content below the WooCommerce product description.
  • After Description Section: Adds a separate content section after the description area.

Goodreads and Reviews Settings

  • Goodreads ISBN 13 / ASIN: Displays the Goodreads Reviews widget for the provided identifier.
  • Reviews: Adds manually managed review or endorsement content to the Book page.
  • Site Reviews: If Allow Reviews is enabled and Site Reviews is installed, the Book page can show submitted reviews and an Add A Review form.

Save Settings as Defaults

The Save Settings as Defaults button copies this Book record's display settings into Default Settings. Any global Default Settings values that are not part of the Book record are preserved. As an example, the Amazon Associate ID and the Hide Amazon Associate Message flag set in the Default Settings will be preserved.

Replace Book Settings with Defaults

The Replace Book Settings with Defaults button applies the current Default Settings to this Book record. Book-specific content such as samples, retailer links, YouTube content, additional text, and review content is preserved.