The process of altering a website's codes to make it search engine friendly is called website optimization and sometimes referred to as on-page optimization. There are a long list of tried and true optimization techniques but putting them into practice depends on the website you want to optimize, normally statics HTML websites can be optimized easily on the other hand implementing some of the optimization techniques might need hard coding for some CMS websites.

For some very famous CMS websites such as WordPress or Joomla there are many useful plugins or extensions that can be used for this purpose.