So I understand the to a moderate degree the tactics of blitzkrieg. But the schlieffen plan had a similar concept of a quick offensive to take Paris, so how come that failed but Hitler didn't. Also this question is not focused on the battle of France how come other theatres maintained a war of movement
The answer to this is quite complex. I'm on a mobile atm. This is therefore only from memory, but I'll try to give you a rough explanation.
You should understand that trench warfare was not an ideal. In 1914 the various armies facing each other on the western front all sought to envelop each others flanks, so as to be able to isolate and crush the enemy forces so caught. As the forces involved were huge, finding flanks and weakspots was no easy task. Commanders on all sides kept lengthening their lines, having their centers digging into defensive positions (trenches), so as to release more forces for offensive operations on the flanks. Within a few months this process resulted in continuous trench systems running from the channel coast to the Swiss border. The armies simply ran out of flanks to exploit. Thus, trench warfare in 1914 was not a result of a desire to go on the defensive. Rather it was an unintended consequence of the desire to maintain offensive freedom.
Having dug in by the autumn of 1914, both the Entente and the Central Powers then spent the next four years desperately trying to find ways to return the war to a more mobile phase such as had existed during the first weeks of 1914. The devises and stratagems proposed to achieve this are too numerous to list exhaustively. Some examples are amphibious operations and secondary theatres (to put pressure where there existed no or few trenches), and various weapons, equipment and tactics designed to neutralise or penetrate trench lines (so that reserve forces could be pushed into the enemy rear, enveloping them just like the goal had been in 1914).
By 1918 both sides had come a very long way towards this goal. The German, British and French (and eventually American) armies had all created equipment and tactics that allowed them to inflict local defeats on enemy trench systems. During 1918 these were then used in concerted efforts by both sides. During the spring offensive in April, German forces overran Entente trench systems on a large scale, capturing more territory than they had since 1914 before being contained. During the 100 days offensives in the autumn allied forces did the same in return, routing the German army along long lenths of the front. By early November allied cavalry, tanks and mobile infantry units were again operating with a similar degree of mobility as they had in 1914. Thus, the means by which trench warfare could be overcome had been both developed and put to practice by the time WWI ended.
Many officers and military thinkers spent the decades after the end of the war trying to elaborate on the lessons learnt during the Great War. How could offensive freedom be achieved and maintained? Again - the results of the processes are complicated, but many focused on even greater use of what had worked in 1918: The use of aircraft tanks and other weapons to bring rapid pressure on enemy weakpoints. Aggressive small unit tactics to identify and exploit opportunities as they presented themselves. Combined arms to achieve greater mutual support for friendly forces.
I'm not gonna go into detail about how the Germans were able to overrun France in 1940. WWII is not really my field of expertise anyway. My point here is simply to argue that when war broke out in 1939 noone wanted a return to trench warfare, and western armies had gotten very good at neutralising trenches anyway. That's not to say trenches were useless 1939-45 (they weren't), but armies had found ways in which they could be defeated. This is a somewhat simplistic explanation, but there is - in short - much greater continuity between warfighting in 1917-18 and 1939-45 than many people think.
Sources:
I'll elaborate further, and add more sources, once I get back to my office in a few days.
I also answered a somewhat related question a couple of weeks ago. You might be interested in some of the sources listed there.