Website request - Let forum moderators merge duplicate posts
Maintainers usually reply within 1 day
@smallbrownbike is already working on this.
Since Nov 13, 2026.
Assessment
This issue has not been assessed yet.
Description
What do you need?
A "Merge into another post…" action in the forum's Moderate menu. Moderators use it when two posts ask the same question. The duplicate post (the source) merges into the other post (the target):
- All comments on the source move to the target.
- The source's text becomes a comment on the target, under its original author.
- People who follow the source now follow the target.
- Links to the source open the target.
Today, a moderator can only archive or delete a duplicate. Both hide the comments on it, and the old link stops working.
Draft content
Not applicable. This is a feature, not a content change. The proposed design is below.
Proposed approach
The merge must happen on the server, in one transaction. A merge in the browser (PUT /api/replies/:id for each comment) is not safe:
- If it fails partway, the comments are split across the two posts.
- The source text gets the moderator as its author.
- Followers, upvotes, counts, and the search index do not move.
- The server can refuse a reply update from a community moderator.
Behavior
Rules. The server refuses the merge if one of these is false:
- The caller is a forum moderator (see open question 1).
- Both posts are published forum posts (they have a
forumTopicand apublishedAt). - The source and the target are different posts.
- The target is not already merged into another post.
What happens:
- Comments: all comments on the source move to the target. This includes unpublished comments. Each comment keeps its author, date, votes, and edits. The thread sorts comments by date, so the moved comments mix with the target's comments in date order.
- Source text: becomes a new comment on the target. The author is the source author, and the date is the source's publish date. The comment starts with
**Merged from: <source subject>**, so the subject is not lost. - Target: keeps its subject, topic, tags, pin, lock, and solution. A comment that was the solution on the source becomes a normal comment.
- Followers: every profile that follows the source also follows the target.
- Upvotes: the target gets the upvotes from both posts. A profile that upvoted both counts once.
- Source: set to
archived: trueandmergedInto: <target>. The record stays in the database for audit. - Earlier merges: a post whose
mergedIntois the source now points to the target, so a link never needs two redirects. - No side effects: no new-comment emails, notifications, or Slack alerts. No points or reputation changes. Jev does not tag the target again, and PostHog AI does not reply.
squeak-strapi
- Schema: add
mergedIntotoquestion(many-to-one relation toapi::question.question). For audit, you can also addmergedAt(datetime) andmergedBy(relation to profile). - Route:
POST /api/questions/:id/mergewith the body{ "into": <targetId> }. Use the same policy as the other moderator actions (pin, lock, move to topic). - Service: do all steps in one
strapi.db.transaction:- Load both posts and check the rules.
- Create the "Merged from" comment on the target.
- Move every reply from the source to the target.
- Add the target to
questionSubscriptionsfor each profile that follows the source. - Join the upvotes.
- Calculate the target's
numReplies,activeAt,lastReplyAt,lastReplyBy,participants, and Active and Popular scores again. Use the code that runs after a new reply, so the values stay the same as for a normal reply. - Archive the source, set
mergedInto, and change earliermergedIntovalues that point to the source.
- Hooks: write the replies so the reply lifecycle hooks do not send emails or give points. Either use
strapi.db.query, or pass a flag that the hooks check. - Search: after the commit, remove the source from the Algolia index and update the target.
- Response: return the target's
idandpermalink. - Docs: add the route to
docs/forum-api.md. - Tests:
- a merge that succeeds
- a caller who is not a moderator
- the same post as source and target
- a draft
- a target that is already merged
- a rollback when a step fails
posthog.com
This is a small change, and it reuses parts that already exist. It needs the Strapi route first.
| File | Change |
|---|---|
src/lib/strapi.ts |
Add mergedInto?: { data: StrapiRecord<QuestionData> | null } to QuestionData |
src/components/Squeak/hooks/useQuestion.tsx |
Populate mergedInto: { fields: ['permalink', 'subject'] } |
src/components/Forum/hooks.ts |
Add mergePost(id, into) to useForumPost, next to updatePost |
src/components/Forum/Thread.tsx |
Add the Moderate menu item, a MergeDialog, and the redirect |
src/components/Forum/README.md |
Add merge to the roles table and the Thread.tsx row |
MergeDialog uses the same parts as MoveDialog (Modal, OSButton):
- A search field finds the target by subject. It uses
useForumPostSearch, which the#suggestions already use. The list does not show the current post. - After the moderator selects a target, the dialog shows: "N comments and the text of this post move to . This post is archived, and its link opens the other post. You cannot undo this."
- Buttons: Cancel and Merge posts. When the merge succeeds, a "Merged" toast shows and the window opens
/forum/p/<target permalink>.
Redirect: when post.mergedInto has data, Thread goes to the target (with replace) and shows the toast "This post was merged into ". This works for old links, emails, search results, and hover cards.
Feeds need no change, because useQuestions already hides archived posts.
The PR needs before and after screenshots of the menu and the dialog: a narrow and a wide window, in light and dark mode.
Out of scope
- Undo (unmerge). The moved comments mix with the target's comments, so an undo is difficult. See open question 2.
- Merging more than two posts in one step. To merge more, do it again.
- Comment threads on docs and blog pages (questions without a
forumTopic).
Open questions
- Who can merge? Community moderators (
isForumModerator), as for move and archive? Or only staff (isModerator)? I recommend community moderators, because the source record stays, so a moderator can repair a bad merge by hand. - Should each moved comment record
mergedFrom? It costs little now, and it would make an undo possible later. - Should the source author get an email that says their post was merged, with a link to the target?
References & examples
- Current moderator actions: the Moderate menu in
src/components/Forum/Thread.tsx(pin, lock, move to topic, edit tags, archive). - A similar pattern: "move to another tag" when you delete a tag, in
src/components/Forum/TopicTags.tsx. - Other forums: Discourse "Move to existing topic", and GitHub "Close as duplicate".
Deadline
No deadline.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 952
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 747
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PostHog/posthog.com
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
PostHog/posthog.com#22222 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
PostHog/posthog.com#22167 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PostHog/posthog.com#22026 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
PostHog/posthog.com#22000 · 1 comment ·
Maintainers usually reply within 1 day
-
Website request - Sources marketing pagesPossibly taken @smallbrownbike claimed this 2 days ago. Openwebsite
PostHog/posthog.com#22336 · 1 comment · 3 assignees ·
Maintainers usually reply within 1 day
All issues in PostHog/posthog.com
Similar issues
-
enhancement needs peer review
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pnp/cli-microsoft365#7696 ·
Maintainers usually reply within 3 days
-
Add: AutomotoOpencheck:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
inmanta/web-console#7899 ·
Maintainers usually reply within 1 day