Skip to content

Instantly share code, notes, and snippets.

@coderaaron
Created March 19, 2020 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderaaron/4630d9e686fc1f49931a42ad18e8c373 to your computer and use it in GitHub Desktop.
Save coderaaron/4630d9e686fc1f49931a42ad18e8c373 to your computer and use it in GitHub Desktop.
mysql -e "SELECT c.post_title, c.post_content FROM wp_posts a, wp_postmeta b LEFT JOIN wp_posts c ON c.ID = b.meta_value WHERE a.post_type = 'nav_menu_item' AND b.meta_key = '_menu_item_object_id' AND a.ID = b.post_id ORDER BY a.menu_order" -u wp -pwp diso --xml > test.xml
sed -i -e $'s/&lt;/\</g' test.xml
sed -i -e $'s/&gt;/\>/g' test.xml
sed -i -e $'s/&quot;/\'/g' test.xml
sed -i -e $'s/&amp;/\&/g' test.xml
sed -i -e $'s/<!--[^>]*>//g' test.xml
sed -i -e $'s/<a[^>]*>//g' test.xml
sed -i -e $'s/<img[^>]*>//g' test.xml
sed -i -e $'s/<\/a>//g' test.xml
sed -i -e $'s/ id=\'[^\']*\'//g' test.xml
sed -i -e $'s/ class=\'[^\']*\'//g' test.xml
sed -i -e $'s/ style=\'[^\']*\'//g' test.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment