When you install GraphComment on your website, each comment posted is automatically linked to a specific page. This link is based on a hierarchy of identifiers, which helps GraphComment always find the right comments, even if things change on your site.
1. GUID (automatic with WordPress)
If you're using our official plugin for WordPress, GraphComment automatically relies on the GUID: a permanent identifier generated by WordPress (usually based on the original URL). This is a reliable system because even if you change the visible URL, the GUID remains the same and the comments stay linked to the right page.
2. UID (a unique identifier you define)
If you're not using WordPress or want to manually control how pages and comments are linked, you can define a custom UID in the JavaScript snippet (the code snippet you integrate into your page).
Example of a snippet with UID:
💡 In the code below, lines starting with
//
are comments. They are notes for humans to understand the code, but they are not executed by the browser.
<div id="graphcomment"></div> <script type="text/javascript"> var __semio__params = { graphcommentId: "demo-gc", // Replace with your own GraphComment ID behaviour: { uid: "article-987654", // Unique UID for this specific page }, }; function __semio__onload() { __semio__gc_graphlogin(__semio__params); } (function() { var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true; gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now(); (document.head || document.body).appendChild(gc); })(); </script>
Using a UID is highly recommended, because it ensures comments always stay linked to the correct page, even if the URL changes.
3. URL (used if nothing else is defined)
If you don’t define a GUID or UID, GraphComment will fall back to using the current URL in the browser to attach comments. This is simple but risky: if the URL changes even slightly (adding a parameter, a slash, etc.), the comments may be considered attached to a new page.
Example:
-
Before:
https://mywebsite.com/amazing-article
-
After:
https://mywebsite.com/amazing-article?version=2
➡️ The comments will not appear anymore because the URL is not exactly the same.
Common Issues: Google Sites, iframes, etc.
Some tools like Google Sites or the use of iframes can make it harder to reliably link pages and comments.
🔍 An iframe is a web page embedded inside another web page. Think of it as a window within a window.
Why this can cause problems:
-
The URL the user sees is not always the one used inside the iframe.
-
Some sites (especially Google Sites) use nested iframes, making URL detection difficult.
✅ In these situations, using a custom UID is required to ensure comment stability.
What to do if comments no longer appear on your page?
You moved an article, switched CMS, or changed the URL? Comments might seem “lost” but they can often be recovered.
In your GraphComment admin interface, go to the PAGES tab to see all detected pages and their associated comments.
You can:
-
Find an old page using its previous UID or URL.
-
Manually update the UID or URL of the page to reconnect the comments.
⚠️ Caution
-
Never assign the same UID to two different pages, or comments might mix up.
-
If you have many pages, manual editing is possible but time-consuming.
Example after site migration:
-
Go to the PAGES tab in your GraphComment admin.
-
Look for the old page (using the previous UID or URL).
-
Click the ✏️ icon to edit.
-
Enter the new UID or URL.
-
Click Save.
✅ The comments should reappear immediately.
⚠️ You cannot currently merge comment threads from two different pages.
Advanced examples: dynamically inserting a UID
In PHP (e.g., WordPress):
behaviour: { uid: "<?php echo 'article-' . $post->ID; ?>", },
In JavaScript:
var articleId = "123456"; var __semio__params = { graphcommentId: "demo-gc", behaviour: { uid: "article-" + articleId, }, };
➡️ These methods automate UID generation for each page, which is very useful on dynamic sites or when using a custom CMS.
In summary
-
Prefer using a UID for each page.
-
The WordPress GUID is reliable if you use our plugin.
-
Avoid relying only on the URL, especially if your site is subject to changes.
-
When needed, the PAGES tab lets you manually restore connections.
Need help? Don’t hesitate to contact our support 😊