diff --git a/app/models/communication/website/imported/post.rb b/app/models/communication/website/imported/post.rb
index c17ffe4b0eb68663032e8a54ac41c5d507747356..3481a3ba8bbb031e5509e66ff7ee1f8e06f3827e 100644
--- a/app/models/communication/website/imported/post.rb
+++ b/app/models/communication/website/imported/post.rb
@@ -122,7 +122,7 @@ class Communication::Website::Imported::Post < ApplicationRecord
         content_type: featured_medium.file.blob.content_type
       )
     else
-      fragment = Nokogiri::HTML.fragment(post.text.to_s)
+      fragment = Nokogiri::HTML.fragment(post.text.body.to_html)
       image = fragment.css('img').first
       if image.present?
         begin
@@ -135,6 +135,6 @@ class Communication::Website::Imported::Post < ApplicationRecord
         end
       end
     end
-    post.update(text: rich_text_with_attachments(post.text.to_s))
+    post.update(text: rich_text_with_attachments(post.text.body.to_html))
   end
 end
diff --git a/app/models/communication/website/imported/with_rich_text.rb b/app/models/communication/website/imported/with_rich_text.rb
index 904e486907b5ae869a09dbf2d94a0ffc7053cf72..3e3f2962ccaba928254523e0a21fb4996bf8b103 100644
--- a/app/models/communication/website/imported/with_rich_text.rb
+++ b/app/models/communication/website/imported/with_rich_text.rb
@@ -1,6 +1,9 @@
 module Communication::Website::Imported::WithRichText
   extend ActiveSupport::Concern
 
+  # https://github.com/basecamp/trix/blob/7940a9a3b7129f8190ef37e086809260d7ccfe32/src/trix/models/attachment.coffee#L4
+  TRIX_PREVIEWABLE_PATTERN = /^image(\/(gif|png|jpe?g)|$)/
+
   protected
 
   def rich_text_with_attachments(text)
@@ -16,7 +19,14 @@ module Communication::Website::Imported::WithRichText
       begin
         url = node.attr(attribute_name)
         blob = load_blob_from_url(url)
-        node.replace ActionText::Attachment.from_attachable(blob).node.to_s
+        blob.analyze
+        blob_path = Rails.application.routes.url_helpers.rails_blob_path(blob, only_path: true)
+        attachment_node = ActionText::Attachment.from_attachable(blob).node
+        attachment_node['url'] = "#{university.url}#{blob_path}"
+        attachment_node['width'] = blob.metadata['width']
+        attachment_node['height'] = blob.metadata['height']
+        attachment_node['presentation'] = TRIX_PREVIEWABLE_PATTERN.match?(blob.content_type) ? 'gallery' : nil
+        node.replace attachment_node.to_s
       rescue
       end
     end
diff --git a/app/services/wordpress.rb b/app/services/wordpress.rb
index fbcc31da776c97c8e91b1156ab6fa4c5608ba5f4..d849a2745945ba097e7ae5a58dcfe4d43dc3e1c8 100644
--- a/app/services/wordpress.rb
+++ b/app/services/wordpress.rb
@@ -24,6 +24,7 @@ class Wordpress
         ]
       }),
       elements: Set.new(Sanitize::Config::RELAXED[:elements]) - ['div', 'style'] + ['iframe'],
+      remove_contents: ['math', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'xmp'],
       whitespace_elements: {
         'div' => { :before => "", :after => "" }
       }