I write on a variety of topics, only some of which it's appropriate to have mathematical typesetting for. To avoid triggering a math rendering engine on unrelated use of $purious dollar sign$, while activating it when $\text{necessary}\wedge\text{appropriate}$, I decided to restrict them to only elements with .language-mathjax. Here's how that's done (for v3):

MathJax = {
	tex: {
		inlineMath: [
			['$', '$']
	startup: {
		elements: ['.language-mathjax']

I also recommend adding the following CSS to the admin-area with a userstyle or something:

.mce-content-body .language-mathjax {
	background-color: peachpuff;

One thought on “WordPress: Restrict MathJax to a class

Leave a Reply

Your email address will not be published.

Warning: This site uses Akismet to filter spam. Until or unless I can find a suitable replacement anti-spam solution, this means that (per their indemnification document) all commenters' IP addresses will be sent to Automattic, Inc., who may choose to share such with 3rd parties.
If this is unacceptable to you, I highly recommend using an anonymous proxy or public Wi-Fi connection when commenting.