Import PGN

In this section, I will walk through the process of importing PGN games into the WordPressChess plugin.

When you import a pgn, the pgn will be saved as a database. A database is a collection of games.

Now, find the Import PGN menu item and click it.

This will bring you to the import PGN page. Here, click the choose file button to choose which file to upload. Navigate to the folder where you have a pgn file and select it.

Then give the database a name in the text below. To name your database is optional. If you leave it empty, the database will be named the same as your pgn file(except the .pgn extension).

If everything looks ok, click the “Import” button. The import may time some time since the plugin has to parse all the games into JSON format which is saved in the database. JSON is just a format which is easily readable by a computer.

Once the import is completed, you will see a confirmation message like below:

Notice the ID(here ID: 7) at the end. This is the id you can use when inserting shortcodes. If you forget it, you can easily find it in the game editor as seen below.

Now, I’m ready to show the games from this database inside this post using a shortcode. The short codes for database games has a format like this:

[chess db="your id" tpl="which template to use for rendering"]

The short code admin menu is useful when finding shortcode. In the picture below, I have selected database template 1, and I'm choosing to show it using the brown theme, i.e. overriding default selected theme for my site.

On that page, I can see that it says that the shortcode is:

[chess tpl="3" db="<databaseId>" theme="brown"]

all values are set except db. When importing the pgn, I noticed that the ID of my pgn was 7, so I'm going to use this short code:

[chess tpl="2" db="7" theme="brown"]

Now, I'm adding my new post and inserting the shortcode where I want the board to appear. Here it's shown below


Share This:

You may also like...

3 Responses

  1. Andrey says:

    Hi. I click on import pgn errors not showing, just a white page, why ? nothing happens. Windows 10, WordPress 4.7.5.

    • Alf says:

      Hi Andrey,

      Is this the free version or the pro version?

      Both versions should support import of pgn, but only the pro version let you show games from imported pgn’s on your website.

      In chrome, try to import again, but before you do, press F12 to open the debug console. Look for any reported errors there.

      I will do some debugging on my end

      • Andrey says:

        Free version. You’ve got mail ? I’d send a screenshot. I want to create a website, and Your plugin I really need.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.