July 24, 2021

How To Backup a Wordpress or Any Static Website

Today my girlfriend fiance wanted to backup an old blog of hers that was hosted on wordpress. There are many tools and applications that you can use but using wget you can download all the static files with a simple command line tool.


wget \
  --convert-links \
  --backup-converted \
  --adjust-extension \
  --recursive \
  --level 10 \
  --page-requisites \
  --timestamping \
  --force-html \
  --restrict-file-names=windows \
  --no-host-directories \

This will download all the static files and update the base urls for links so they still work when run locally. Additionally you can run this as many times as you want and it will only update files that have been updated since the last download. Enjoy!