There are at least 3 development periods to be explained. The name Ngayogyakarta existed in 1755 when Mangkubumi Prince whose title was Sri Sultan Hamengku Buwono I founded the Kingdom of Ngayogyakarta Hadiningrat. The kingdom that was built on the Bering Forest area was a realization of Giyanti Agreement done with Pakubuwono III from Surakarta.
It is unclear when the name Yogyakarta first existed, whether it is a contraction of the name Ngayogyakarto or because of other reasons. However, the name of Yogyakarta has been used formally since the independence of Indonesia. When it became the capital of Indonesia in 1949, this student city had been called Yogyakarta. Sri Sultan Hamengku Buwono IX also used the name of Yogyakarta when he announced that this kingdom is part of Indonesian Republic.
Some other names such as Yogja, Jogja, Jogya and Yogya came afterwards. The variations may exist from different pronunciation of people from different parts of Indonesia. Interestingly, people will refer to the same area when they hear those different names.
For business purpose, the name of Jogja becomes more popular and it is used in the slogan Jogja Never Ending Asia. The slogan is intended to build the image of Yogyakarta as a tourism city having great natural and culture enchantments. The reason to choose the name 'Jogja' is that the pronunciation of the word is relatively easy for most people, including foreigners. Some institutions once replaced Yogyakarta with Jogjakarta.
YogYES.COM uses the name Djokdja in Tour de Djokdja rubric. This name was used during the Dutch colonial time. The proof was the presence of a hotel named Grand Hotel de Djokdja at the north end of Malioboro Street by that time. Now, the hotel is still in operation but the name changes to Inna Garuda. The name of 'Djokdja' is chosen to give an impression of an old city and to invite the readers to fill with nostalgia.
With various spellings and pronunciations, Yogyakarta is the only city with many variations of name. Jakarta only has one variation: Jayakarta, while Bali does not have any other name. Other tourism cities in the world such as Bangkok, Singapore, Cartagena, or Venice do not seem to have variations; neither metropolitan cities such as New York, Los Angeles, and London.
Now, you do not have to be confused when you find someone writing the name of Yogyakarta city as the way he spells it. When you browse in the Internet to find out more about this city, you would better use the name Yogyakarta as it is the most commonly used in writing. The second commonly used name is Jogja.