Is it correct to have a comma after "so" when "if" comes right after it? Example: "I visited California for a week. So[,] if you were wondering where I was, there's your answer."
It's not always required, but it is correct in your example. In the case of your example, the section "if you were wondering where I was" is a separate thought or element, so it is offset from the rest of the sentence by the commas. It could be omitted or retained, and the meaning would be the same. Personally, I tend to put in commas quite frequently, wherever a spoken sentence might have a brief pause or a change in tone. I find it easier to parse the text that way.