According to Sikh Scholar G S Talib (in Encyp. of Sikhism), Waheguru is a compound of two words, one from Persian and the other from Sanskrit. Wah in Persian is an interjection of wonder and admiration and Guru in Sanskrit means a spiritual parent or preceptor.
According to McLeod (Historical Dictionary), the term ‘Wah guru’ first appears in the Janam – sakhis where it means ‘Praise to the Guru’. The two words eventually coalesced to form one of the characteristic names of God.
Surprisingly, though it is now very popular with Sikhs, yet Sikh Gurus did not use it more than once or twice in their bani in Guru Granth Sahib.