I just installed Mathematica, which has a CDF Deployment Wizard. This is supposed to make it easy to post a CDF file on a WordPress blog. I tried it, and it indeed was easy; the problem is that when I Previewed the post, the CDF logo showed up and created a rectangle that quickly turned solid gray.

This is the entire code I used in my blog:

<p>&nbsp;</p> <p><strong>The example</strong></p> <div> <script
<script type="text/javascript"> var cdf = new cdfplugin();
cdf.embed('http://www.abstractmath.org/Mathematica/Elaborate Riemann
Example.cdf', 427, 536); </script>     </div>

The two scripts were created by the Wizard and pasted into the post. You can download the file Elaborate Riemann Example.cdf yourself from the URL above, and, if you have CDF Player on your computer, you can run it. It works fine on my computer. But it won't appear within the post.

Any ideas why?

  • $\begingroup$ Could you please give URL to the page which does not work? $\endgroup$ Commented May 5, 2012 at 23:57
  • $\begingroup$ Just a guess: what if you change 'http://www.abstractmath.org/Mathematica/Elaborate Riemann Example.cdf' to 'http://www.abstractmath.org/Mathematica/Elaborate%20Riemann%20Example.cdf'? $\endgroup$
    – Szabolcs
    Commented May 6, 2012 at 12:21
  • $\begingroup$ The web page is at abstractmath.org/Word%20Press/?p=4362 $\endgroup$ Commented May 6, 2012 at 14:06
  • $\begingroup$ Putting %20 in for space doesn't work. $\endgroup$ Commented May 7, 2012 at 1:04

2 Answers 2


I downloaded your notebook to my Download directory and opened it. The Download directory is unsafe. This is what it looked like:

enter image description here

So the reason why you get a grey box in your embedded CDF is that it is perceived as being unsafe.

Modify your code to this:

cdf.embed('http://www.abstractmath.org/Mathematica/Elaborate Riemann 
Example.cdf', 427, 536,{fullscreen:'true'});

and it will allow the enable dynamics button to appear. You can then switch on the dynamic content and the CDF will be treated as safe. This will get you to the next stage. Whether or not it will work after that will depend on what other things you have in your CDF -- i.e. as long as you have content that is allowed (no import/export etc.) it should work.

  • $\begingroup$ What I now know is that the trouble is in the cdf file, not with the code that loads it into the blog. If you look at the blog now -- abstractmath.org/Word%20Press/?p=4362 -- you will see that I added another cdf file from a previous post that worked in that post and works in the current one as well. $\endgroup$ Commented May 7, 2012 at 1:06
  • $\begingroup$ Did you try fullscreen:true? cut and pasted your link but it does not exist. $\endgroup$ Commented May 7, 2012 at 1:24
  • $\begingroup$ The Notebook Security tutorial in Mathematica Help says that a notebook will produce the Unsafe Dynamics message if (among other things) it uses conversion between expressions and strings or options control (among others). My notebook uses both of these, so it appears that my only recourse is to do what Mike Honeychurch suggested and add "{fullscreen:'true'}" to the embedding code, and then say in my post that the reader may click on the Enably Dynamics button to manipulate the diagram. $\endgroup$ Commented May 7, 2012 at 1:50
  • $\begingroup$ Mike: "abstractmath.org/Word%20Press/?p=4362" works on my browser (Chrome). I tried it just now. $\endgroup$ Commented May 7, 2012 at 1:53
  • $\begingroup$ All I get is page not found. Sorry but until you can provide a link that loads there is nothing further I can add. $\endgroup$ Commented May 7, 2012 at 3:25

Whatever the problem might be, using this official Wordpress plugin from Wolfram Research should resolve it: http://wordpress.org/extend/plugins/wolfram-cdf-plugin/

Update: First I would like to acknowledge that Mike Honeychurch found that correct answer to this question, nevertheless a plugin could be the cause of many other troubles. For using CDFs with WordPress there is now a new plugin, written by me, which supersedes the one I mentioned above: https://wordpress.org/plugins/mathematica-toolbox/

  • $\begingroup$ I tried that and it made no difference. $\endgroup$ Commented May 6, 2012 at 14:05
  • 1
    $\begingroup$ not if it contains content that is insecure. $\endgroup$ Commented May 7, 2012 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.