According to reports, the ban imposed in Mecca's Masjid al-Haram, known as the Great Mosque of Mecca, and Medina's Masjid an-Nabawi, or 'The Prophet's Mosque,' was taken by the Saudi foreign ministry on Nov 12.
The change was communicated by the ministry through a diplomatic note sent to accredited representatives of foreign countries on Saudi Arabian soil.
Saudi authorities stated that the measure was imposed to protect and preserve the holy sites, prevent disturbances of worshippers and ensure tranquility while performing acts of worship.
In recent years, many pilgrims to both holy sites have posted pictures on Instagram and Facebook, ranging from posing in front of the Kaaba, to taking selfies on the upper floor of the Grand Mosque to standing under the umbrella-like canopies at Nabawi Mosque.
Some have even posed in groups, carrying banners or flags of their respective countries in the yards of the two mosques. Critics have said such "touristy acts" detracted from the essence of a pilgrimage as they raised questions about whether the pilgrimage was just a trip to take photos.
"In the case of any violation of the ban, security guards have been instructed to confiscate the photos and the camera if needed," the statement said, adding that the change should be disseminated to every Hajj and Umrah tour operator in their respective countries.
Many Indonesians have expressed their disappointment, saying that photos and videos taken at the mosques were meant as mementos, especially as visiting the sites may be a once-in-a-lifetime opportunity.
Indonesian Nadhira Adiatri remembers taking photos with her family in front of the Kaaba at the Al-Haram Grand Mosque during her Umrah (minor Hajj pilgrimage) to Mecca five years ago.
"I agree it's annoying when people take too many photos and selfies, but it's a pity if we are no longer allowed to immortalize the beauty of the Kaaba or the moving dome in Nabawi Mosque," the 25-year-old said.
At that time - before smartphone image-sharing apps Snapchat and Instagram became a part of everyday life - security guards at the mosque were already hostile toward people taking photos in the holy compound, she said.
"I only took a few photos using my smartphone camera to capture memorable moments, but I did it quietly to avoid disturbing others and only when the guards were not around," Nadhira said.
Nur Hikmat, 27, who plans to go on Umrah next year, said instead of enforcing the ban over the whole compound, Saudi authorities should determine specific areas to ban picture taking.
Another Indonesian who recently returned from Mecca, told the Jakarta Post he had noticed that the ban was already enforced at the Grand Mosque, but that the implementation was not yet strict.