Hi @simon
If I use your code, the entire URL is removed and there is no output at all. Check out: 02.21.2018-13.52.37 - TechSmith Screencast
I think there is is an error in your code, but I can’t find out what it is.
Looking forward to your reply. Thanks a bunch!
P.s. why not remove the onebox output natively from the WP Discourse plugin alltogether below WP Posts? That it just returns the URL as a default without using this code? I think it would be the easiest option to prevent corrupt looking oneboxes all together for all users out there?