How to clear chat window
If you copy&paste the following code to the end of any .lua file in your addons folder, you can use slash command /clear to clear all chat windows.

Lua Code:
  1. SLASH_COMMANDS["/clear"] = function()
  2.    for i = 1, #ZO_ChatWindow.container.windows do
  3.       if _G["ZO_ChatWindowTemplate"..i.."Buffer"] then _G["ZO_ChatWindowTemplate"..i.."Buffer"]:Clear() end
  4.    end
  5. end

This slash command uses code written by Fathis Ules.