You did say SOUTH American possessions. That means that the Royal Family relocates to Bogotá, New Granada rather than Ciudad Mexico (or to Bogotá from Mexico City perhaps in 1811 as a result of Hildago and Morelos's revolt getting too close for comfort). The challenge dosen't require that Spain retain Mexico and Central America. Only South American colonies.
As a result, Spain has enough troops to put down and capture Simon Bolivar, who is hanged in 1812.
Reforms are made and in 1815, work begun on a Respedura canal connecting the Atrato and San Juan Rivers and therefore Atlantic and Pacific Oceans, thus binding South America together militarily (using African slaves) as well as with the Philippines once the King is nearby and can hear about the site and even visit the site and see that the canal is both feasible and necessary and only 7 leagues long. The canal is finished in 1820, in time for service by the new steamboats which can tug ships upstream and downstream on both rivers within two days.
King Ferdinand is far more aggressive about settling underpopulated areas in the New World. Even in the Exile Years (1807-1814) and Voluntary Exile Years (1814-1820), Ferdinand is creating penal settlements in Florida on Tampa and Miami Bays and sending convicted criminals to St. Augustine, St. Marks and Pensacola to boost the Spanish population, build the economy and fend off American demands for annexation of the Floridas. As well, large numbers of slaves are brought to Florida and land cleared for plantations, particularly sugar in the south.

risoners are also sent to California and Texas for the same reasons and new settlements founded farther north on the Pacific coast at Humboldt Bay (Nuevo Cantabria), the Columbia estuary (what DID the Spanish call the Columbia anyway?) and Puget Sound (Nuevo Navarra?). And farther north up the Rio Grande, where gold and silver are promptly discovered which makes it all worthwhile.
The Spanish and Portuguese Kings also, during this Exiled Court period, conclude a mutual defense treaty against the encroachment of other powers and treaties defining the Amazon River and it's tributaries the Napo, Pastanza, Maranon, Hallega, Putamayo, Uapes, Ucayali, Madiera and Negro Rivers, the Orinocco and it's tributaries the Apure, Meta and Cassiaquare Canal and the Parana and it's tributary the Paraguai River and the Tagus River and Duoro Rivers in Spain and Portugal as international waterways, open to the shipping of at least both Spain and Portugal. Which would be vital when it came time to face Admiral Cochrane.
And when Napoleon is defeated, like the Portuguese Emperor Manuel, Ferdinand's court in Bogata is in no hurry for the King to return to Madrid. So from Bogata, the King issues edicts ordering the relocation of all displaced persons to the New World from Iberia--as soon as shipping permits it. And institutes primogeniture with second and subsequent sons recieving lands equal to their inheritance in Spain, but undeveloped in the New World.