Knights are noblemen who are trained to fight and adhere to a code of chivalry. Though the rules of being a knight aren't described explicitly in the world of Shrek, details about them can be inferred.
In the opening story book, knights are shown to be brave and noble as they try to slay the dragon that guards the princess in order to rescue her. They wear full sets of plate armor and ride decorated horses. Lord Farquaad gathers the most accomplished knights of Duloc (who each wear unique sets of armor) to compete in a tournament that will decide who he will send to rescue Princess Fiona for him. The knights attack Shrek without question when Farquaad orders them to. After they are all easily defeated, Farquaad extends his "great and noble quest" to Shrek instead,
Littered across the Dragon's Keep are the skeletons, armor, and weapons of the many knights who were slain by Dragon while trying to rescue Fiona. Shrek puts on pieces of armor found among a pile of knight remains, as he knows the princess is expecting a knight to rescue her. Dragon doesn't hesitate to try and eat Shrek and Donkey, presumably because all the other knights attacked her without hesitation. During her rescue, Fiona lists her expectations of a knight; a knight should be romantic, awaking her with a kiss and reciting her poetry. He should sweep her off her feet so they can ride a rope out her window and land onto his horse. A knight is versed in royal etiquette and knows what to do with Fiona's favour. A knight is expected to "charge in, sword drawn, banner flying" to slay the dragon before rescuing the princess. Shrek criticizes this line of thinking, pointing out to Fiona that while all the other knights did this, this was "right before they burst into flame" shortly afterword.
Fiona was expecting her knight-in-shining-armor to be human, and is also annoyed that the man who wants to marry her didn't even come to rescue her himself. When Farquaad arrives at the windmill to meet Fiona, he is dressed like a knight and riding an armored horse. Later Fiona sees a suit of knight armor on display that reminds her of Shrek while preparing for her wedding.
Prince Charming takes on the expected appearance of a knight on his journey to rescue Fiona, wearing a suit of armor and riding a valiant steed. In Fiona's bedroom in Far Far Away, Fiona has a set of toys that include a knight slaying an ogre. She also has posters on the wall of knights like Sir Justin and Sir Lancelot (the latter of which is likely not the Lancelot that appears in Shrek the Third). There exists a reality TV show called "K.N.I.G.H.T.S." that follows the knight guards of Far Far Away.
The knighting ceremony is a ritual in which a would-be knight would swear an oath and the master of the ceremony would dub the new knight on the shoulders with a sword. Shrek takes part in knighting an unknown squire in the Far Far Away Palace, though Shrek accidentally drops the knighting sword onto him. At Worcestershire Academy, Lancelot is seen practicing jousting which is a sports contest carried out by knights. Prince Charming recruits the Black Knights to join his cause.
In an alternate universe it is revealed that without Shrek to rescue Fiona from the Dragon's Keep, no knight was able to defeat Dragon and rescue her.
- As revealed in Shrek's Commentary Track, an unused idea was that Shrek wanted to go out in the world and become a knight only for his parents to tell him that "ogres can't be knights". This is supported by concept art of Shrek in an armory trying on armor, and also storyboard sketches of Shrek in a full set of armor.
- Though the Duloc Guards wear suits of armor, they are never referred to as knights by other characters.
- In the Dragon's Keep, Shrek and Fiona pass by a giant cooking book opened to a recipe about preparing knights.
- Unlike knights' usual portrayal as noble heroes, the knights in Shrek are typically depicted as being unchivalrous, incompetent, or both. This goes along with the series' overall theme of subverting fairytale traditions and expectations.