Novel methods of synthesizing heteroatom-containing porphyrins and metalloporphyrins are disclosed. Each of the solid shape elements is defined by a number of concave portions, a number of convex portions or a combination of concave and convex portions. 05 to 80 ppm of an ionic liquid whose anionic component is bisimide is added thereto.