Origin of the 40 Days
Our Sages (Chazal) have long spoken about the Segula of praying for 40 consecutive days. Whether one recites King Solomon's Song of Songs (shir hashirim), King David's psalms (tehillim) or personal heart-felt words, 40 days is a significant time period to arouse G-d's mercy.
Praying for 40 consecutive days specifically at the Western Wall (Kotel) is a famous practice of Jews in Jerusalem. Most people have heard about the popular Segula through word-of-mouth and have made the pilgrimage for marriage partners, income, children, healing and other.
According to Rav Sheinberger, author of a popular commentary on the the definitive book of Kabbalah (Zohar), the Segula was officially coined by Rabbi Yisroel Yaakov Fisher, of blessed memory - one of the leading Sages of the last generation. Dayan Fischer reportedly said that if someone goes to the Western Wall for 40 consecutive days to pray for 1 thing, it was a special Segula of its own.
Dayan Fischer zt"l