WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am on wordpress and i am writing php or mysql code in a post but finally when i hit publish it gives an Server Error : 500 , i also trying putting my code under [code] [/code] tags nothing happened but when i remove my codes and hit publish then it's working

Any idea guys Waiting for help

share|improve this question
Are you trying to display code or actually run code? – Wyck Sep 1 '11 at 5:45

With a stock WordPress install, you cannot insert server side code like PHP directly into a post, only HTML-compatible text. Using the [code][/code] shortcode only outputs what is inside as PRE and CODE elements of HTML, useful for showing code to your readers. In general, it is a bad idea to put code directly into a post.

Thank being said, there are several plugins that will give you this capability. See the following:

share|improve this answer
thanks a ton joshua – Jonathan Aug 1 '11 at 20:20
No problem, go ahead and accept the answer if it worked for you so others know how to embed PHP as well. – Joshua Aug 1 '11 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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