Bayonets were not 'rendered useless' by machine gunners. Bayonets were useful for close quarters combat, especially in the trenches and during trench raids, and became important in the fighting of 1917-18 as the battles began to transition back to 'open warfare'. I've read numerous accounts, notably from 1916, of British, French and Canadian infantry making effective use of bayonets during the capture of enemy positions; it was NOT useless. Hell, 'rifle-and-bayonet men' were among the specialists trained to carry out French infantry attacks, along with 'bombers' and light machine-gunners, from 1915 onwards.
Furthermore, the big killer of WWI, as in, '60-70% of all casualties were caused by it', was artillery not machine guns.
Some more answers I've given, which should help: