Difference between revisions of "WordPress Permalink Manager Plugin"

Wiki.TerraBase.info
Jump to navigation Jump to search
m
m
Line 34: Line 34:


recent-history/attachment/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid22
recent-history/attachment/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid22
<br /><syntaxhighlight lang="text">
one to many
SELECT * FROM wp_posts WHERE post_date='1999-09-13*';
SELECT * FROM wp_posts WHERE post_date LIKE '1999-09-13%';
This works to display: SELECT ID FROM wp_posts WHERE post_date LIKE '1999-09-13%';
This works to insert into another table (clear the TT2 table first)
INSERT INTO TT2 (ID, post_date)
SELECT ID, post_date
FROM wp_posts
WHERE post_date LIKE '1999-09-13%';
SELECT * FROM wp_postmeta WHERE post_id = '2799';
SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID = '2799');
SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID = ?);
SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID LIKE '%');
SELECT *
FROM wp_posts
INNER JOIN wp_postmeta
ON wp_posts.ID = wp_postmeta.post_id
WHERE post_date LIKE '1999-09-13%';
SELECT *
FROM wp_postmeta
INNER JOIN wp_posts
ON wp_posts.ID = wp_postmeta.post_id
WHERE wp_posts.post_date LIKE '1999-09-13%';
set autocommit=0;
COMMIT;
# or if you want to reset changes
ROLLBACK;
</syntaxhighlight>

Revision as of 08:06, 24 March 2020

Make sure all TARGET Media is attached to a Page (not a Timeline Event)

   Wordpress calculates the Default URI / Original URL* as WhatEverItIsAttachedTo(IfItIsAttached)/NativeSlug (It is not saved, instead calculated)

   The NativeSlug is stored in the wp_posts.post_name Table.Column, and can be easily modified with a SQL query

"Tag" the desired media (WhatEver1) to change with a custom date (1999-09-13, AKA September 13, 1999) using the Bulk Edit feature of Admin Columns

Use a SQL Query to add / prepend the new custom path (example: recent-history/images/, no leading /, but add the trailing)

Change date back to original or current

Then go to the next desired media and tag it (WhatEver2, 3, etc.) and repeat the above steps (3 lines)

...and after all SQL Modifications; Permalink Manager, Tools, Regenerate / Reset, Mode: Use Original (Default) URLs as custom permalinks

OR, go to debug tab (far right) and wipe all data.

Optional (Not recommended as it can be done via SQL): Permalink Manager, Tools, Regenerate / Reset, Mode: Regenerate Native Slug

*NOTE: Permalink Manager exchanges the use of "Current URI" with "Custom Permalink" in the Regenerate/Reset Tool

   ...and "Default URI" with "Original URLs" too.

Permalinks Manager: Regenerate custom permalinks and Use original URLs as custom permalinks does the same thing

(The Default URI is copied to the Current / Custom URI)

recent-history11/attachment11/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid11

recent-history/attachment/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid22

recent-history11/attachment11/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid11

recent-history/attachment/salton-sea-stuck-boat-high-res-no-rv-not-as-vivid22


one to many

SELECT * FROM wp_posts WHERE post_date='1999-09-13*';

SELECT * FROM wp_posts WHERE post_date LIKE '1999-09-13%';


This works to display: SELECT ID FROM wp_posts WHERE post_date LIKE '1999-09-13%';




This works to insert into another table (clear the TT2 table first)

INSERT INTO TT2 (ID, post_date)
SELECT ID, post_date
FROM wp_posts
WHERE post_date LIKE '1999-09-13%';




SELECT * FROM wp_postmeta WHERE post_id = '2799';
SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID = '2799');




SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID = ?);

SELECT * FROM wp_postmeta WHERE post_id = (SELECT ID FROM TT2 WHERE ID LIKE '%');



SELECT *
FROM wp_posts
INNER JOIN wp_postmeta
ON wp_posts.ID = wp_postmeta.post_id
WHERE post_date LIKE '1999-09-13%';



SELECT *
FROM wp_postmeta
INNER JOIN wp_posts
ON wp_posts.ID = wp_postmeta.post_id
WHERE wp_posts.post_date LIKE '1999-09-13%';





set autocommit=0;

COMMIT;
# or if you want to reset changes 
ROLLBACK;