Skip to content

Instantly share code, notes, and snippets.

Forked from Suleman-Elahi/
Created March 23, 2021 07:03
What would you like to do?
Get All WordPress Tags in Excel (CSV) using WordPress WP API v2
import requests
import csv
import time
from tqdm import tqdm
tags = {}
pages = int(requests.get('').headers['X-WP-TotalPages'])
for i in tqdm(range(pages), ncols=65):
js = requests.get(''+str(i+1)).json()
for entry in js:
with open("tags.csv", "w", newline='') as f:
datawriter = csv.writer(f)
Copy link

Make sure to run pip install requests tqdm before running the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment