What to substitute for corn meal depends completely on the type of recipe. Corn meal is used either for its flavor or for its texture. In the case of substituting for texture, a substance with the same degree of grind must be used. In the case of flavor, a corn product must be used. The best option is to search your pantry for corn meal in disguise in products labeled under different names.
Grits and cornmeal are virtually the same thing; the only difference between the two is that one is ground finer than the other. Grits are much coarser than corn meal, creating a thicker product when added to water. Use grits in general baking or cooking recipes. If a liquid batter is needed, use slightly less grits than the amount of corn meal called for.
As with grits, anything in powder form that is labeled as polenta is simply corn meal in disguise. Boxed or bagged polenta flour is nothing more than medium to coarsely ground corn meal or grits. Depending on the grind, it can be used interchangeably with corn meal and vice versa. If the polenta grind is coarse like grits, use slightly less in a liquid batter based recipe, otherwise use it as a full ratio replacement.
Corn meal is the finely ground version of grits and polenta, and corn flour is the finely ground version of corn meal. Corn flour is the finest grain of corn available but creates a much different texture than corn meal does. If your recipe is one based on the flavor of the corn meal rather than the texture, such as corn bread, then corn flour is the best option. Masa harina, the typical corn flour used to make tortillas, can also be used, though it will add a slightly different flavor to your recipe due to the presence of lime during grain processing.
Depending on what you are making, substituting any type of flour in place of the corn meal in the same ratio, such as one cup for one cup, will work fine. Using wheat, tapioca, rice or any other type of flour in place of the meal will slightly alter the taste and the texture of the item, but it will not destroy it, particularly in baked goods. Breads, cakes and cookies that require corn meal along with other types of flours can have the corn meal substituted by more of the other ingredients. Since corn meal is a slightly rougher texture than flour, substitute with an equal amount of wheat, ground nut or oat flour. Nothing is certain with substitutions. Experimentation is always necessary to know if something will work in a given recipe or not.