Recent searches
No recent searches
Closing comments on community posts
Posted Jan 28, 2022
Hi @...,
Back in May of last year you provided some helpful information about potentially using the API to move or delete posts from a particular date range. It seems the post has been deleted as my original links to it no longer work. I was hoping to get some information about identifying community posts of a specific date range and closing them for comments. Is this possible?
The use-case is:
We are a software company and as such, a lot of our older posts report issues and provide feedback about a state that our software is no longer in. In an effort to encourage folks to start create new posts instead of commenting on old posts we were hoping to close comments on posts before a certain date.
Any advice or info would be greatly appreciated.
1
6 comments
Ifra Saqlain
Hello Jason Kaiser,
I tried something for you but not with the API, only using JS. You can hide the comment box on the old post and show a link to redirect to the new post page.
Here, I'm checking a specific date to disable comments on old posts.
You can check any attribute value in if() condition and hide or do something with the comment form of the post page.
You can get attribute of (".post li.meta-data > time") and check the value with if().
Please let me know if it works for you :)
Thanks
Team
0
Jason K
Thanks Ifra Saqlain, let me give it a try and see how it works out.
0
Jason K
Hi Ifra Saqlain, this solution worked for us! I appreciate you sharing.
0
Ifra Saqlain
Cheers! happy to hear.
0
Jason K
Hey Ifra Saqlain, I was curious if you had any advice for how to manipulate the code above to either:
Thank you 🙂
0
Ifra Saqlain
Hey Jason Kaiser,
Here we go --
To get the topic IDs -
1- Go to that post where you want to change something accordion to the topic ID.
2- Now, see in the search bar on your screen.
3- As you can see, those numbers are the topic ID, I wrapped those in red border.
4- Copy those numbers, go to the script code, remove 000000 and paste this ID.
Your second query is:
Here you only need to change the year - remove 21 and add yours.
For multiple years:
If any query do let me know :)
Thanks
Team
0