From the first pages of Henri Barbusse's best-selling war novel/memoir Le Feu (Under Fire, 1916), based on his experiences as a French poilu in the trenches of WW1.
"Tiens, old man," says Tulacque, as he comes up. "Look at this." Tulacque is magnificent. [...] He holds his face in advance as he walks, a forceful face, with eyes that squint. He has something in his hand. "I found this while digging last night at the end of the new gallery to change the rotten gratings. It took my fancy off-hand, that knick-knack. It's an old pattern of hatchet."
It was indeed an old pattern, a sharpened flint hafted with an old brown bone — quite a prehistoric tool in appearance.
"Very handy," said Tulacque, fingering it. "Yes, not badly thought out. Better balanced than the regulation ax. That'll be useful to me, you'll see." As he brandishes that ax of Post-Tertiary Man, he would himself pass for an ape-man, decked out with rags and lurking in the bowels of the earth.
From Ernst Jünger's WW1 memoir In Stahlgewittern (In Storms of Steel, 1920), adapted from his diary:
The trench walls were of chalk, and this withstood the weather much better than the clay we were accustomed to. In places the sides of the trench were even carefully walled, and the floor of it concreted for long stretches, so that even in the heaviest rain the water could soon run away. The reddish-white rock abounded in fossils. Every time I went to my dugout with a pocketful of mussels, starfish, and ammonites.
In addition to his fossil collection, Jünger, a "passionate entomologist", also took time to collect beetles, and recorded 143 specimens in his notebook titled Fauna coleopterologica douchyensis.
So indeed, soldiers in WW1 did found interesting artifacts while digging trenches. More generally, military authorities uncovered a large number of archeological sites when displacing millions of tons of earth to build fortifications and observation posts on either side of the long front line.
At that time, archeology, as a discipline, was developing unevenly in Europe: while it was certainly getting more scientific and international, it still had a wild side, with private collectors and local amateurs buying artefacts directly from excavation workers. In France, notably, archeologists were often local erudites, such as priests or schoolteachers. It was better organized and more professional in Germany.
As a result, archeological findings were generally not treated with much interest in the French side. According to Landolt et al., 2014, who have described in detail how archeological findings were dealt with in Alsace and Lorraine during WW1, Allied headquarters did not publish specific directives concerning the findings. A few French amateur and professional prehistorians and archeologists who were either soldiers or present near the frontline did report their findings in short notes in scientific reviews. This was the case for instance of Paul Trassagnac, an amateur archeologist and an army doctor, who published several notes in the Bulletin de la Société Préhistorique Française in 1915 and 1916:
The war has naturally turned my occupations and preoccupations for nearly nine months towards an object quite other than prehistory; but, since the trenches began to be dug in the line of fire, while attending to the wounded, I did not neglect to cast an inquiring glance at the cross-section of the terrain uncovered. Even recently, taking advantage of a momentary lull in the fighting in which my regiment took part, I was able to undertake excavations, a few hundred metres from the enemy. In this respect, the few finds that I have made so far could attract curious people, which would make me decide to present them to the Society, if the thing were possible at this time.
The scholarly association Société Préhistorique Française created in 1917 a "commission of subterranean refuges" under the authority of the French army and some of his members were able to visit archeological sites found in the trenches. Armand Viré, a biologist and speleologist, reported a few prehistoric and Gallo-Roman finds:
We will not insist further on these finds, made quickly and at random while digging the trenches. We only hope that these quick notes can be used later by archaeologists, when Artois, devastated by Teutonic savagery, can think of something other than its provisional reconstitution.
But these findings, "made under gunfire" - the French reports always mention vividly how difficult it was to collect objects with German machine guns just over the ridge - remained limited and generally disappointing for the French side. Sites remained poorly localized and identified. Many were destroyed during the fighting and could not be found after the war.
The Germans, as mentioned previously, were better organized. Archeological research during WW1 was part of a general policy of art conservation (Kunstschutz) that was more or less coordinated at various levels. In the early days of the war, the German army had set fire to the library of the University of Louvain, destroying hundreds of thousands of books and manuscripts, and they had shelled and partly destroyed the cathedral of Reims. These "cultural atrocities" had led to the creation of the Kunstschutz policy in German-occupied territories (for a description and analysis of this policy in Belgium and France, see Kott, 2007). The Kunstschutz aimed at preserving and protecting the "art of the enemy", for a variety of ambiguous reasons: public relations (to show to the local populations that Germans were men of culture and not the brutes described in Allied propaganda), safeguarding art in the name of humanity, imperial propaganda (according to which the real Barbarians were the French, who failed to protect their heritage), and organized pillaging. In some cases, it was meant to prove German influence on Gallo-Roman culture.
To this task, the Kunstschutz policy employed a large number of academics, including art historians and museum curators. In the field of archeology, methodic excavations were done in territories next to the frontlines, where a German administration was already functional. Emperor Wilhem II, who was fond of archeology, visited excavation sites. German soldiers were often the ones to make the discoveries, and their findings were examined by art administrators and other specialists and then studied or at least transferred to a safer place. This was the case for instance of the skelton of a saurian, found by men of the 30th Infantry Regiment in Cheminot (Moselle) in 1915, of Merovingian sarcophagi of Varvinay, and of a Gallo-Roman altar in Norroy-lès-Pont-à-Mousson (Meurthe-et-Moselle). More extensive diggings were done by German soldiers and Russian prisoners in the antique city of Senon (Meuse), which uncovered several buildings from the Late Roman Empire period. The paper of Landon et al., shows some of the German discoveries made in Alsace and Lorraine. Unlike the French ones, these were methodically, scientifically described, and covered most of European prehistory and history.
Sources
Barbusse, Henri. Le feu (journal d’une escouade). Paris, E. Flammarion, 1916. http://archive.org/details/lefeujournaldun00unkngoog.
Jünger, Ernst. The Storm Of Steel. New York: Howard Fertig, 1929. http://archive.org/details/ErnstJngerTheStormOfSteel.
Kott, Christina. Préserver l’art de l’ennemi ? Peter Lang, 2007.
Landolt, Michaël, Bernadette Schnitzler, Jean-Claude Laparra, Franck Mourot, and Jean-Pierre Legendre. ‘Des tranchées aux musées : l’archéologie pendant la Grande Guerre en Alsace et en Lorraine’. In Situ. Revue des patrimoines, no. 23 (20 February 2014). https://doi.org/10.4000/insitu.10882.
Soulier, Philippe. ‘Un Siècle de Bulletin de La Société Préhistorique Française (1904-2004)’. In Un Siècle de Construction Du Discours Scientifique En Préhistoire, 27–125. Avignon, 2004.
Trassagnac, Paul. ‘Fouilles dans les tranchées militaires’. Bulletin de la Société préhistorique française 12, no. 5 (1915): 241–47. https://www.persee.fr/doc/bspf_0249-7638_1915_num_12_5_7030
Trassagnac, Paul. ‘Notes sur quelques fouilles pratiquées dans les Tranchées’. Bulletin de la Société préhistorique française 12, no. 7 (1915): 331–42. https://doi.org/10.3406/bspf.1915.7023.
Viré, Armand. ‘Notes de guerre Préhistoire et archéologie dans les tranchées d’Artois en 1915’. Bulletin de la Société préhistorique française 17, no. 2 (1920): 57–64. https://doi.org/10.3406/bspf.1920.7628.
I have a follow up question - how common is it for archaeologists to be working at a dig somewhere in Europe and accidentally discover unexploded ordinance left over from either of the world wars?