WordPress XML to Google Sheets
Convert XML exported from WordPress onto Google Sheets.
About
A Spreadsheet-bound apps script solution to convert XML exported from the native WordPress tool into your Google Sheets file.
This is a solution with a very limited target: if you want to export the contents of your WordPress-powered website into your spreadsheet, using existing WordPress plugins should be your first choice. Crawl the web for keywords like
wordpressandcsv. Or if you are using WordPress versions 4.7 or later, you should be able to take advantage of the WordPress REST API, which, as part of the WordPress core features, would provide you with a more integrated experience.This particular solution can be useful for those who do not/cannot install new plugins for some reason, and/or those who are using old versions of WordPress that are too old for newer features.
Install
You can either
- Copy this sample spreadsheet or
- Copy & paste the file contents inside the
srcdirectory of the GitHub repository using Google Sheets’ script editor.
In the latter case,
- Name the HTML file together with its directory
src/, i.e,dialog.htmlshould be save assrc/dialog.htmlon the script editor. You wouldn’t need to change the default file namecode.gs; just copy the contents ofxml2sheets.jsinto it. - Copy the contents of worksheets
Template - ChannelandTemplate - Itemsto your spreadsheet.
Be sure to reload the spreadsheet after saving the script.
How to Use
- From the menu, select
WordPress XML to Sheets>Parse XML. - You will be prompted to upload the XML file that you exported from your WordPress website. Select your file and
Upload. - After about a minute of waiting, you will see a couple of worksheets created on your spreadsheet. One to give you a summary of the website and the other for the whole list of contents that you exported.
Terms and Conditions
You must agree to the Terms and Conditions to use this solution.
Source Code
Source code is available on GitHub. Please make requests for enhancements or reports of bugs via the GitHub issue. License regarding the use of the code is available on the GitHub repository.