Are you trying to embed your entire forum in another site? That won’t work.
The OP describes how to embed lists of topics on another site, but you can’t run Discourse in an iframe for the reasons that you describe.
Are you trying to embed your entire forum in another site? That won’t work.
The OP describes how to embed lists of topics on another site, but you can’t run Discourse in an iframe for the reasons that you describe.
No just the latest topics. I followed the instructions to enable the embed topic in settings and copied the scripts to the header and body of the host site. Not sure if the error is caused because the dev site I’m testing it on hasn’t got ssl
This is due to the security settings on your site, not on the Discourse side.
Got it working. Just didn’t read the instructions carefully enough
So this is working great, my only issue is that Google is indexing the iframe url itself
For example, I have Discourse topics embedded on this page
Google seems to index the above page OK… but its also indexing the below URL’s which I’d like to fix
Is there a way we can get a meta noindex on the above pages? Or even better , get this new google tag on the above pages
Interesting thanks for the tip @nader… should we add this new tag to the <iframe>
by default @falco, or make it a setting?
This should do it
Just thought I’d point out this is serving the ' noindex, indexifembedded '
to all crawlers even though its just google who supports the new indexifembedded
This should probably change to x-robots-tag: googlebot:noindex, indexifembedded
Or removed completely as the noindex could have unforeseen consequences on other search engines.
I doubt the extra word is particularly harmful to other crawlers. Do you have any evidence that this is the case, e.g. are any other crawlers telling sites not to use indexifembedded
?
(Most of the time when writing code like this you tend to ignore any HTML tags you aren’t expecting, that’s sort of the default for HTML.)
I don’t see that but on the google page it does say
Presently, only Google supports the
indexifembedded
tag.
I agree they’ll ignore the indexifembedded
, my worry though is that the noindex
causes SEO issues for the page its on.
So lets let bing crawls a url that has topic embeds. It crawls that URL and also crawls the embed URL
/embed/topics?discourse_embed_id=XXXXXX....
If the above is noindex
, I’m worried it hurts the SEO for the page that is featuring the topic embed
This is all fixed by using x-robots-tag: googlebot:noindex, indexifembedded
but could understand why Discourse may not want to favor 1 Search engine. Hopefully, it becomes standard but for now it seems it’s just google.
Hi there! Just wanted to ask if there’s still no built-in way to make embedded topics open as target="_blank"
instead of target="_parent"
Just curious why I can only get it to show 1 topic? Does anyone know?
Here’s the category (that has many topics): Amazon Specific - eCommerce Sellers Forum
And the embed code:
<d-topics-list discourse-url="https://forum.flowster.app" template="complete" top_period="all" category="17" per-page="5"></d-topics-list>
But only one topic appears:
I see all the requested topics: https://forum.flowster.app/embed/topics?discourse_embed_id=de-k0ofgk7q0&category=17&per_page=5&template=complete&top_period=all
Maybe the div where the iframe lives is too small for you to see the other ones?
@Falco Thanks for your help! Using that link I see multiple topics, however why doesn’t this html code work? Am I doing something wrong with the <d-topics-list>
tag?
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://forum.flowster.app/javascripts/embed-topics.js"></script>
</head>
<body>
<d-topics-list discourse-url="https://forum.flowster.app" template="complete" top_period="all" category="17" per-page="5"></d-topics-list>
</body>
</html>
Does anyone know the answer? Why my HTML code above doesn’t work?
When google renders a page that features the Discourse topic embed feature it seems to use capital <div>
elements.
The below is a screenshot of the rendered HTML from the google search console.
One issue with embedded topic lists is that when an embedded topic list entry is clicked, users are always taken to the first post in the topic. We had a request via our support system to ask if there was anyway that users could be taken to the last
post in the topic instead of the first.
If this is something that would be useful for other sites, is there any way that a last
parameter could be added to the embed code so that users would be automatically taken to the last post in the topic instead of the first one?
I realize that this goes against the idea that discussions are intended to be read from the beginning to the end, but since it’s not possible to store a user’s last read post on the site that the topic list is embedded on, allowing sites to point users to the last post in the topic might be reasonable for this case.
I thought this was worth bringing up again its sort of a severe SEO issue to have on a page.
The headers for the urls created using the embed topics have a x-robots-tag: noindex,indexifembedded
The indexifembedded is only for the google
It should look more like X-Robots-Tag: googlebot:noindex,indexifembedded
Or perhaps just remove the tag all together.
The real negative is that bing or any other crawler will not index or account for the content displayed by the embed topic. ( because it only picks up on the noindex
part )
That is exactly what we want right? I don’t want any crawlers to index anything under /embed/topics
directly.
Hi @Falco
Im dont think so as that would mean my example url doesnt get indexed.
Google is crawling those urls as separate urls. Distinct from the url the embed topic is displayed on.
It will still crawl my url
https://www.flynumber.com/products/virtual-phone-number/australia
but Bing will get to the embed/topics url , see the nonindex and not count that towards the above url.
While Google wont index the embed/topics url but since it understands the “indexifembedded” it will still count the content towards the page where the embed is displayed.