One SEO professional asked John Mueller about whether source code could be considered duplicate content.
Their situation is that they work at a developer staffing company and they publish technical article content weekly about things like developer hacks and tips in their blog section.
Is it okay to have the same external source code as a reference to two or more articles? For example, if you have five different articles talking about express.js topics, but you’re using the same source code information from a referring source.
Is this still considered duplicate content, even if it’s just the source code from another project?
John explained that he believes there are a few assumptions here. One assumption is that duplicate content is a problem that you need to fix, which is usually not the case.
The other assumption is, if there’s a part of a page that is considered duplicate content, this is a bad thing. John stated that it’s not necessarily a bad thing.
From a practical point of view, what would happen here is Google would recognize that a part of the page is the same as other pages that they have seen.
If someone were to search for a line of text or a piece of text, specifically to that shared section, then they would try to pick one of those pages to show in the search results.
Whereas if someone is searching for something that is relevant to the text around that, then they will try to find the best matching page appropriately.
From this perspective, if you’re sharing the same code snippet, people probably are not likely searching for that code snippet, but rather, they are searching for the information around that code snippet.
For instance, “how to do something special in JavaScript,” and then they find that page. And as an example, they have that code snippet there, but they don’t search for the code snippet itself.
From this perspective, that’s perfectly fine.
This happens at approximately the 35:50 mark in the video.
John Mueller Hangout Transcript
John (Submitted Question) 35:50
I have a question about duplicate content. I work at a developer staffing company and we publish technical articles weekly about developer hacks and tips into our blog section. Is it okay to have the same external source code as a reference to two or more articles? For example, if you have five different articles talking about express.js topics, but using the same source code information from a referring source, is this still considered duplicate content, even if it’s just the source code from another project?
John (Answer) 36:19
So I think there are a few assumptions here as well. On the one hand, that duplicate content is a problem that you need to fix, which is usually not the case. And the other is kind of like if there’s a part of a page that is considered duplicate content, is that a bad thing? And no, that’s not necessarily a bad thing. So from a practical point of view, what would happen here is we would recognize that a part of the page is the same as other pages that we’ve seen.
And if someone were to search for a line of text or a piece of text, specifically to that shared section, then we would try to pick one of those pages to show in the search results. Whereas if someone is searching for something that is relevant to the text around that, then we would try to find the best matching page, appropriately. So from that point of view, if you’re sharing the same code snippet, probably people aren’t going to be searching for that code snippet itself, but rather, they’re searching for the information around that code snippet.
I don’t know, “how to do something special in JavaScript,” and then they find that page. And as an example, they have that code snippet there, but they don’t search for that code snippet itself. And from that point of view, that’s, that’s perfectly fine. It’s okay to have some kind of shared element on a page talking about the same thing.