I've been trying to get my ahead around open-source software licensing (which I probably should have done much earlier than I am!)

From what I can tell, because posts made on WP SE are automatically licensed under CC BY-SA 3.0 (and not 4.0 - see https://creativecommons.org/compatiblelicenses/), code snippets from this site can't actually be combined into a Wordpress project (if it is going to be distributed).

Have I understood this correctly?

As a followup question, does any user who posts WP code samples on this site violate the GPL by re-licensing their GPL derivative code under CC BY-SA?

2 Answers 2


It's a huge mess, welcome to code licensing!

As it stands right now content on SE network is indeed under Creative Commons with all the implications.

Some people grant additional permissions to their code contributions, for example I explicitly license all my code here under MIT as well (by saying so on my profile).

Obviously Stack Overflow existed and had this problem even longer than WPSE too. So this is basically elephant in the room, the world of programming is choke full of code originated there. Alas, that gives more responsible people (and lawyers I guess) a fit.

So my personal approach — if you want to use substantial (I know this is vague, I define this for myself as considerable chunk of code, implementing some functionality) code from SE then ask the author to license it fittingly. I did this multiple times and never was denied.

Tiny logicless (or nearly so) snippets, you could write yourself quickly, I think are fair use and fair game. If someone magically enforces licensing on all of that — programming industry will collapse overnight. :)

If you want bulletproof certainty just ask for license for everything.

On the SE network level there are now plans to switch code license to more permissive. Guess what — it's a huge mess. See A New Code License: The MIT, this time with Attribution Required

As a followup question, does any user who posts WP code samples on this site violate the GPL by re-licensing their GPL derivative code under CC BY-SA?

If you mean WP code in general — the GPL derivative stance of WordPress project is more their wishful thinking than a real thing. Official plugin and theme repositories themselves do not enforce this.

If you mean GPL code from elsewhere (like WordPress core) used here in answers — it falls under fair use (more or less).

  • Thanks heaps for this explanation, @Rarst, it's helped me understand it more. How did you come to the decision to use MIT for your contribs? I've noticed it's somewhat common to do so, some use Apache 2.0 as well. What do you think about releasing contribs into public domain (such as thru CCO?)
    – Tim Malone
    Commented Apr 11, 2016 at 0:07
  • In relation to Wordpress derivative stance, I'm pretty sure their official repos require 100% GPL, even though they admit eg. theme CSS doesn't classify as derivative. For my purposes, I think I'd prefer to comply with the spirit of their licensing and license my themes/plugins as GPL.
    – Tim Malone
    Commented Apr 11, 2016 at 0:08
  • And one more comment - I found a suggestion on Open Source SE that you could re-license SE contribs as CC BY-SA 4.0 and then as GPLv3. If this is sound, this looks like a great way to go: opensource.stackexchange.com/questions/2234
    – Tim Malone
    Commented Apr 11, 2016 at 0:11
  • I blogged about my preference for MIT rarst.net/code/license-compatibility , GPL has crappy compatibility with Apache. Hadn't considered public domain, permissive license works for me. "official repos require 100% GPL" — wrong, they don't, only require GPL–compatible license.
    – Rarst
    Commented Apr 11, 2016 at 8:04
  • Thanks for clarifying, I did indeed misread the 100% GPL compatible note on the Wordpress site! Checking out your blog post.
    – Tim Malone
    Commented Apr 11, 2016 at 10:04

OSS licenses are a big mess and you will need to ask this question at the OSS licenses stack (forgot which one it is, but there is one).

The general answer though, is don't use anything as it is from this site. While some code might work when just copy and pasting it, the purpose of the answer is to highlight approaches to fix problems, and not to be an "out of the box" solutions. Use the answer only as inspiration, and you don't even get into the copyright minefield ;).

On top of that most answers describe facts, which most likely either prevent any copyright protection for them, or will make a reuse of them legal under "fair use", but this might be tricky and depend on the individual answer.

Last but not least. SE is doing a disservice by letting people think that the code here is licensed under any OSS license. The copyrights to some of the code posted here do not belong to the poster and therefor even if he understood the complexities of SE licensing, the code is not his to relicense in the first place. Big Corps will probably not accept any code copy and pasted from SE in order to avoid even the slight chance of copyright infringement by mistake.

  • Thanks for your answer Mark Kaplun. I selected Rarst's as the answer because of the additional explanations he provided, but +1 for the pointer to the Open Source stack, where I found opensource.stackexchange.com/questions/2234
    – Tim Malone
    Commented Apr 11, 2016 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .