saw this Q & A which seems relevant:
Q: » I purchased o house in 1997 and I'm thinking of selling. Because of the long ownership the selling cost is much greater than the purchase price I paid. Will I have to pay the full CGT. The property is in the Malaga district.
A: » You would probably need to pay a lot of plusvalía tax, besides the CGT. My advice would be to gather all official invoices you have incurred for home improvements, solicitors costs etc and even the costs and invoices form your purchase in 1997, since you can deduct all these costs from your CGT. There is, of course, the exception I mentioned in this article " There are exceptions when the seller does not have to pay capital gains tax and that is when the sellers of the property are older than 65 and have lived there officially for at least the last 3 years.". I do not understand your statement that the selling costs are greater than the purchase price.
Property prices in 1997 in Málaga were much lower compared to nowadays, so you should be able to make a good profit even after paying CGT, plusvalía, solicitors, agency commission, etc... Anyway, you should ask a gestoría (Spanish bookkeeper) or your solicitors to have them calculate your net profit. In the old days (more than 5 years ago) it was a common practice to buy a property with big sums of B money to avoid paying extra taxes.
Nowadays, it is almost impossible to do that since the tax office will make their calculations and buyers and sellers can get fined for selling at a low price reduce your CGT, you could also sell your house furnished, since furniture is taxed at a much lower rate, I think only 4%. To do that you would have to make an inventory list. So if you sell it for 800.000 euros you can allocate 50.000 euros as part of the furniture for example.