Skip to content

Automatically delete URLS after some time #3008

Answered by ozh
icsy7867 asked this question in Q&A
Discussion options

You must be logged in to vote

Your cron based system would totally work

My plugin way would be : instead of running the SQL query on every page load, run it once every 24 hours. How ? In the option, store the last time the query was run (add option "last-delete-old-links" => "2021-07-26 01:03:37" for instance) and if the time is 23.5 or 24 hours later than this date, run the query and update the option.

I'm sure there are plugins already for this (I don't know how they work, though). Check https://github.com/YOURLS/awesome-yourls

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by dgw
Comment options

You must be logged in to vote
1 reply
@joshp23
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants