Skip to content

Instantly share code, notes, and snippets.

@hzg
hzg / html-to-wppost--tag-date.sh
Created March 23, 2018 19:58
Import local html to Wordpress Posts [Date in HTML Tag]
#!/bin/bash
#
# Requires Wp Cli - run in root of wp core install
##
echo "WP HTML File Importer - REQUIRES WP CLI"
read -p "Press enter to continue"
# CHANGE THIS YOUR DESIRED SRC
@hzg
hzg / html-to-wppost--filename-date.sh
Created March 23, 2018 19:56
Import local html to Wordpress Posts [Date in File Name]
#!/bin/bash
#
# Requires Wp Cli - run in root of wp core install
##
echo "WP Post HTML File Importer - REQUIRES WP CLI"
read -p "Press enter to continue"
# CHANGE THIS YOUR DESIRED SRC
@hzg
hzg / vbulletin_attachment_folder_converter.sh
Last active December 5, 2017 21:25
Bash script that will convert legacy vbulletin attachment directory structure from ./1234/xxxx.attach to ./1/2/3/4/xxxx.attach in order to import into xenforo
#!/bin/bash
echo "vb4 Attachment Folder Structure Splitter"
# CHANGE THIS YOUR DESIRED COPY LOCATION
DEST="../dest"
for i in $(ls -d */); do
OLDDIR=${i%%/} #Set old director var
COUNT=${#OLDDIR} #Get Number of Directories
TOTAL=$((COUNT + 1)) #Set the total to plus 1
COUNTER=1 #Set Counter