Last active
September 11, 2024 20:29
-
-
Save haze83/3b25d478b1419f22a856e74c9eeca0e7 to your computer and use it in GitHub Desktop.
WP DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://decodeunicode.org/en/u+2028 | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id = 3646; | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT meta_value | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT meta_value | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT post_id | |
FROM wp_postmeta | |
WHERE | |
meta_value LIKE CONCAT('%',CHAR(0xE280A8),'%') | |
AND (meta_key LIKE 'skuld-fieldcontent%' OR meta_key NOT LIKE '%skuld%') | |
) | |
AND meta_key = 'skuld-content-version-content_id' | |
) | |
); | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT meta_value | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT post_id | |
FROM wp_postmeta | |
WHERE | |
meta_value LIKE CONCAT('%',CHAR(0xE280A8),'%') | |
AND (meta_key LIKE 'skuld-fieldcontent%' OR meta_key NOT LIKE '%skuld%') | |
) | |
AND meta_key = 'skuld-content-version-content_id' | |
) | |
; | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT post_id | |
FROM wp_postmeta | |
WHERE | |
meta_value LIKE CONCAT('%',CHAR(0xE280A8),'%') | |
AND (meta_key LIKE 'skuld-fieldcontent%' OR meta_key NOT LIKE '%skuld%') | |
) | |
AND meta_key = 'skuld-content-version-content_id' | |
; | |
SELECT * | |
FROM wp_postmeta | |
WHERE | |
meta_value LIKE CONCAT('%',CHAR(0xE280A8),'%') | |
AND (meta_key LIKE 'skuld-fieldcontent%' OR meta_key NOT LIKE '%skuld%'); | |
SELECT * | |
FROM wp_posts | |
WHERE ID IN ( | |
SELECT post_id | |
FROM wp_postmeta | |
WHERE | |
meta_value LIKE CONCAT('%',CHAR(0xE280A8),'%') | |
AND (meta_key = 'skuld-html-content' OR meta_key NOT LIKE '%skuld%') | |
) | |
AND post_type IN ( | |
'page', | |
'attachment', | |
'acf-field', | |
'acf-field-group', | |
'nav_menu_item', | |
'job', | |
'location', | |
'news' | |
); | |
SELECT DISTINCT post_type FROM wp_posts; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- delete canceled, failed and complete actions | |
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'canceled'; | |
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'failed'; | |
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'complete'; | |
-- empty logs | |
DELETE FROM `wp_actionscheduler_logs`; | |
-- delete actions before date | |
DELETE FROM wp_actionscheduler_actions | |
-- SELECT * FROM wp_actionscheduler_actions | |
WHERE 1=1 | |
AND wp_actionscheduler_actions.status IN ( | |
'complete', | |
'failed' | |
) | |
AND wp_actionscheduler_actions.scheduled_date_local < '2024-09-01 00:00:00' | |
; | |
-- delete orphaned claims | |
DELETE FROM wp_actionscheduler_claims | |
-- SELECT * FROM wp_actionscheduler_claims | |
WHERE wp_actionscheduler_claims.claim_id NOT IN ( | |
SELECT | |
as_actions.claim_id | |
FROM wp_actionscheduler_actions AS as_actions | |
) | |
; | |
-- delete orphaned logs | |
DELETE FROM wp_actionscheduler_logs | |
WHERE wp_actionscheduler_logs.action_id NOT IN ( | |
SELECT | |
as_actions.action_id | |
FROM wp_actionscheduler_actions AS as_actions | |
) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment