WP投稿を同じ名前の既存のDiscourseトピックと自動的に同期させたいです。タイトルからトピックを取得する方法は?

You could do it manually with this:

Or write a script that calls a function similar to this:

Since you only have the topic titles, and not the topic ids, I think you’ll need to make a request to the Discourse topic without the id and get the redirect that’s returned from Discourse. Something like curl http://localhost:3000/t/your-topic-without-the-id -s -L -I -o /dev/null -w '%{url_effective}'