Yes, people from the region of present-day Ghana undertook the Hajj pilgrimage to Mecca long before the 19th century. Well-established trans-Saharan trade routes connected the Ghana Empire (and later West African kingdoms) to North Africa and the Middle East, facilitating not only commerce but also cultural and religious exchange.
As Muslim merchants traversed these desert routes—trading gold, salt, ivory, and other goods—they brought Islamic teachings with them. By the 11th century, Islam had taken root in the Ghana Empire's ruling circles and trading communities. The famous Almoravid movement further accelerated conversion across the western Sudan.
Historical records, including accounts from Arab geographers like Al-Bakri (11th century), document West African rulers and scholars making the arduous journey to Mecca. The Mali Empire's Mansa Musa's legendary 1324 pilgrimage—though later than the Ghana Empire's peak—demonstrates the deep-rooted tradition of Hajj from the region.
These pilgrimages often took months or years, with caravans crossing the Sahara's harsh terrain. The journey itself became a profound expression of faith and a catalyst for further Islamic scholarship in West Africa.