How to render a variable which is having a wysiwyg type format?
You should use check_markup for that:

$item = variable_get('web_pagetext', ['value' =&gt; '', 'format' =&gt; '']);
$formatted_text = check_markup($item['value'], $item['format');