The magnetic field due to a long solenoid is given as B = µ0ni, where n is the number of loops per unit length. So, if we add more loops at the ends of the solenoid, there will be an increase in the number of loops and an increase in the length, due to which the ratio n will remain unvaried, thereby leading to not a considerable effect on the field inside the solenoid.