You may find it difficult to avoid touching the first string with the third finger while fingering the root 5 major bar chord. However, it is common practice to mute the first string with the third finger as an alternative fingering for this chord.
You may also prefer to bar the first five strings only and mute the 6th string with the tip of the first finger. Now the key note will be the lowest note produced when the chord is strummed, helping to give a clearer, more accurate sound to the chord.