Yes, there's obviously something crucial I've missed.
My opinion, which may be slightly semantic, is that forts were never deemed useless and this is a popular misconception, perhaps confused with the argument that such defensive zones were not worth the money (which is an argument I will not address).
A "fort" as a stand alone barricade that can stand impregnable forever was of course no longer on the cards. However, a "fort" as a heavily fortified zone with pre-planned zones of fire, gun emplacements, logistics stores, barracks, etc that is ALSO part of a larger plan of defense was never seen as outdated.
The only difference between the western front trench lines and a "fort" is one of geometry. In our heads, a fort is a self enclosed structure or zone that the enemy can maneuver while the trench system was (by design) unable to be bypassed.
Although I consider the Maginot line to be more akin to a trench system than a simple "fort", I'll address some of the actual "Forts" of WW1 and show that they were not so useless during the war. Also please be aware of this concurrent response by nietzza on the Maginot Line which details how it was supposed to be a complement to a greater defense plan, and not simply a stand alone static defense.
The forts at Liege are probably the "poster child" for "lol forts", but they had various technical shortcomings in their design that dramatically impaired their effectiveness in the first place, were given woefully inadequate infantry support, and of course the defensive armor was by that time inadequate to protect their fix emplacement, outdated, vulnerable, and outnumbered heavy artillery. (For more, read The Forts of the Meuse in WW1 by Clayton Donnell. Like most Osprey books in that vein it is quite short and not cheap for the page count, but it fills a niche.) The Belgians tried to use Liege as a "fort" in the stand alone sense, and to be honest even then they performed reasonably well given the level of commitment the Belgians invested (though not as well as hoped).
The forts at Verdun played key roles in holding the Germans back in the Verdun campaign. They, by contrast, were given heavy infantry support and much artillery (as any casual Great War student is aware). The Verdun forts also had some technical elements that were superior to the Liege forts (retractable cupolas, for one), and there had been some time for the French to learn various lessons by 1916 that the Belgians did not have the advantage of.
Setting Verdun aside, let's talk about Przemyśl. (It's pronounced Shemy-shill or Shemy-shull, roughly, in case you don't want to outright murder the word like the Great War Channel youtube does.) The city of Przemyśl is located about 3/4 of the way from Krakow to Lviv (then known as Lemberg), right on the Polish side of the Poland/Ukraine border. It was, in the Great War, also home to Austria-Hungary's crown jewel fortress complex... which is a mixed endorsement. It was big, and had been very advanced at one time, but had been greatly neglected (both because Austria-Hungary doubted the value of forts before the war, and also because Austria-Hungary neglected most things relating to the military in terms of money). In fact the Austrians had to rush thousands of laborers to the fortress at the outbreak of war to make some hasty refurbishments and improvements (largely basic things like clearing forests for fields of fire, laying barbed wire, digging trenches and gun emplacements).
Now, most people in the English speaking world (which I will make the assumption that OP is, apologies if I am incorrect) don't know the first thing about the Eastern front other than Tannenberg, so most people don't know about the Sieges of Przemyśl. Despite being improperly supplied, the forts of Przemyśl survived a 3 week siege by the Russian 3rd army, which suffered very heavy casualties attempting to storm the forts of Przemyśl (generally placed at 40,000). The siege was briefly lifted due to other developments in the theater, but reestablished in early November. The fortress would continue to hold out despite supply shortages and a burdensome civilian population that the military had failed to properly evacuate (causing many of the civilians to be spooked by rumors of Russians and returning to the city) and not surrender for almost 5 months near the end of March. This siege, by the Russian 11th Army, declined to press the assaults (after seeing the costs of the first siege) and mostly allowed artillery and starvation to work. It is possible the fortress could have held out still longer had it not become obvious that efforts to reach Przemyśl through the Carpathian mountains (during winter in one of the most tragic military campaigns of the war, sometimes known as the "Karpatenkrieg," or somewhat less snappy sounding "Schlacht in den Karpaten") would fail. For more detail on the Przemyśl fortress and the 1914-1915 sieges, please see Written in Blood: the Battles for Fortress Przemyśl in WW1 by Graydon Tunstall (as a corrollary, I recommend Blood on the Snow: the Carpathian Winter War of 1915 by the same author to learn about Austrian attempts to relieve the fortress).
Far from being "useless" (though perhaps still not cost efficient), forts amply demonstrated their ability to be a defensive force multiplier during the Great War. Naturally, the Germans would want to go around a new state of the art fortress zone if they could, both to avoid the loss of men and material and the loss of time. Further, the area of fortification was one that was naturally receptive to being fortified. During the Battles of the Frontiers the Germans already had a very difficult time advancing through French resistance in the line of Epinal-Nancy-Verdun due to the combinations of hills and forests. And, of course, the French 2nd and 3rd Armies.
At any rate, I hope I have clarified the issue of "forts" somewhat. Any pre-planned, well constructed defensive zone (a fort, fortress, trench network) was proven in the Great War to give the defender a large force multiplier that would take the attacker either a significant manpower/artillery advantage, heavy casualties, and much time to overcome (and usually at least 2 of the 3). Commanders in WW2 would avoid such places whenever possible.
edit: some basic grammatical errors