• I’ve integrated my WordPress database with ASP.NET where I directly request the content from the WordPress database. So the rendering of the HTML is NOT done by WordPress, but first requested by ASP.NET and then rendered to the browser.

    The problem is that WordPress adds tags like <p> and <br/> to my posts’s content when they are rendered to the frontend. Since in my case this rendering is not done by WordPress, I need to be able to store the content of a post as raw HTML in the WordPress database.

    I however do want WordPress editors to still work on the ‘View’ tab, instead of having them work on ‘Text’ tab in the HTML.

    How can I do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • It will be easier if you can modify how ASP.NET renders the output, i.e. detect and render HTML from the string. Take a closer look into literal control or use Response.Write(htmlString);

    Maybe you could hook into save_post action, process the content with wpautop function and save it separately into the database. The question is where to save it. You could consider using update_post_meta, but the resulting selection query in ASP.NET would be slightly more complex.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Store raw post HTML in WordPress database’ is closed to new replies.