Generally speaking, if you need 5000 words, there is not much problem in writing 8000 or 10000. If you write too much, explain the content in detail, and the teacher agrees. It is also a good thing to write too much.
I suggest you ask the teacher's opinion first to see if there are any repetitions or redundancies in these nearly 30 thousand words. You can delete unnecessary content. It's best not to delete it yourself, but to listen to the teacher's advice.