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.
From this perspective, that’s perfectly fine.
This happens at approximately the 35:50 mark in the video.