author avatar

Glenn 2.0

Menu

How to Import Your GoodReads List Into WordPress, for free

GoodReads web site logo

Here are the steps I took in order to get all of my GoodReads books/reviews over into my IndieWeb-ified Wordpress:

Prerequisites:

After import you'll need to add some PHP and CSS to display the new custom fields, most likely inside the_loop - where this is will depend on your theme. For Twenty Seventeen I did the officially recommended child theme and am inserting my code there under Template Parts > Post > content.php - here is my code, just to give you an example. This php statement pulls in the number of pages, which is one of the columns I imported:

<?php
$pages = get_post_meta($post->ID, 'pages', true);
?>

Your pages will now be assigned to the '$pages' variable, which you can use to display that number like this:

<?php 
if ($pages) { ?>
<p class="book-meta">Pages: <? echo $pages; ?></p>
<?php } 
else 
{ 
// do nothing; } 
?> 

One thing that does not get imported from GoodReads is book cover images. However, if you have the isbn or isbn13 number, I found a way to hotlink to book cover images using Open Library. They are specifically set up for just that purpose. Here is my code to assign the isbn to a variable:

$isbn13 = get_post_meta($post->ID, 'isbn13', true);

And here is how to structure the html to display a medium-sized book cover image:

<?php 
if ($isbn13) { ?>
<a href="http://openlibrary.org/isbn/<?php echo $isbn13; ?>
"><img align="right" src="http://covers.openlibrary.org/b/isbn/
<?php echo $isbn13; ?>-M.jpg"></a>
<?php
} 
else { 
// do nothing; 
}
?>

Other pages in this section: