Use a wire brush to clean off and dirt, debris or rust from the area which you are looking to weld. This detritus can cause the porosity and bubbles to appear in the final weld.
Dampen a cloth and use it to clean away any loose particles which have emerged during the cleaning with the wire brush. This should leave you with a smooth surface onto which to weld.
Reduce the amperage power of the weld and also adjust your electrode angle and reduce your travel speed. This will ensure the weld metal completely fills the melted-out areas of the metal you are welding, thus eliminating the main cause of excess porosity.
Keeping the tip of the nozzle about one inch away from the surface you are welding. This will ensure a consistent level of penetration and avoid excess bubbling or, conversely, a lack of penetration.