I want to limit the visibility of comments under a page (or even the entire website) to a fixed number of days. Say 7 days. If the comment is older it should not be visible.
I first tried searching for an existing plugin to do the job but no success.
So I tried to come up with some solution myself.
I managed to get my own query in a plugin to work with a shortcode and list the comments that were within the clause. But I also needed a form to add new comments. Therefor I need the comments to be activated on the page, But this will also show the WP native comments and form. If I disable the comments on the page my own form is also gone.
I don’t dislike the native comments, they are fine by me, so I tried to add filters to the plugin instead of my own list but it had no effect on the native comments. Older comments are still being shown.
Has one of you an idea on how to approach this problem, a plugin or a snippet of code that can help me further?
If I had to program it myself from scratch it would have been such a problem but WordPress is just a bit too complicated for me at times. 🙁
The code I tried is still on my work-computer. This code didn’t work but could be handy as a reference for what I did try. I could post it tomorrow.
Thank you in advance for taking the time to hear me out.
- You must be logged in to reply to this topic.