Skip to content

Instantly share code, notes, and snippets.

@n8finch
Created May 10, 2017 06:04
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 n8finch/61d35c6c48cd1562c99834a2bd396f48 to your computer and use it in GitHub Desktop.
Save n8finch/61d35c6c48cd1562c99834a2bd396f48 to your computer and use it in GitHub Desktop.
some incomplete SQL scripts.
SELECT
wp_redirection_items.*,
wp_redirection_groups.position AS group_pos
FROM wp_redirection_items
INNER JOIN wp_redirection_groups ON
wp_redirection_groups.id=wp_redirection_items.group_id
AND wp_redirection_groups.status='enabled'
AND wp_redirection_groups.module_id RLIKE 'd'
WHERE (wp_redirection_items.regex=1 OR wp_redirection_items.url RLIKE '\/$')
17154
105
17259
/* SELECT
wp_redirection_items.*
FROM wp_redirection_items */
UPDATE wp_redirection_items
SET url = REPLACE( url, '/nate', '')
regex = 1
WHERE url NOT REGEXP '/$'
/* UPDATE wp_redirection_items
SET url = CONCAT( url, '[/]?') */
WHERE url NOT REGEXP '/$'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment