I reduced a 5 MB kml file to about 1.3 MB. Step one is to remove all track points and many path points. Only two points are needed for a straight line but GPS receivers might record dozens.
There are automated tools to filter tracks but I prefer to hand-edit.
Step two is to optimize the style information in the kml file. Google Earth Desktop (GED) is useful for editing paths and setting styles, but it never seems to delete a style so you end up with a megabyte (in my case) of duplicate identical styles.
The kml file is in plain text so any text editor can be used to merge styles and delete duplicates. This task is tedious and likely to result in errors, so I found a workaround:
Make a duplicate kml file as a backup and remove all the style information. This is simple and quick. Save the file and open it in GED.
I organised all elements with shared styles into kml folders. Then set the style of each folder resulting in one definition for hundreds of paths or way points.
There is a final foible (bug?) in GED; when you share a folder style, all the folders below including those that are not sub-folders inherit the style.
This is an odd behavior - a bug in my opinion!
So drag the folder to be altered to the bottom of the list. Set the shared style and then drag it back to the top or middle.
I have folders for walks, public-transport-routes, long-distance-paths, bus-stops, train-stations, parking, pubs, points-of-interest and hazards so I need to set about nine styles.
This only takes a minute or two so it's an efficient solution not needing additional software.
As I add new walks and pubs to the file, the duplicate styles start to accumulate again so from time to time the optimization has to be re-done. This is the optimized kml file.