Toccaville

blog

WordPress:Gutenbergに移行したら表示が微妙だから、クラシック枠からカスタムHTMLに移動させた紆余曲折

2019.01.17 Akiko Kubo

既存サイトをWordPress最新版にアップデートすると、地味に手間がかかることがあったのでメモ。

今回の経緯↓

  1. なんだか表示が微妙なところがあるので 見ていたら、pとbrタグが外れていた

  2. 下記の記事を見つけてやってみた WordPress 5.0 Gutenbergで段落ブロックのpタグが反映されない時の解消法 https://www.vektor-inc.co.jp/post/wordpress-5-0-gutenberg-p-tag/

  3. 表示したいpとbrタグが入るようになったが、 全体的に余計なpタグも入ってしまい、これまた表示が微妙

  4. remove_filter(‘the_content’, ‘wpautop’); を追加する方法を試したが、効かない。

  5. Gutenbergだと効かないと気づく。 検索していると、以下の検索ワードが出てくるので、 悩んでいるのは私一人じゃない様子 Removing wpautop does not work in Gutenberg

  6. 2の対処をやめる。 classやidが無い、単なるや だと外れるので、 のように、仮のclass名をあえて追加。

  7. 現状、これで表示は問題ないが、 ほんとは仮のclass名なんか、つけたくない。

  8. そういえば入力枠を変えればいいのかも、と思って「クラシック」に入っているコードを まるっと「カスタムhtml」に貼り付け。 「カスタムhtml」だと余計なpタグが入らず、解決。

     					[prev](https://www.toccaville.com/blog/portland-hip-revolution/)
     					[一覧に戻る](/blog/)
     					[next](https://www.toccaville.com/blog/this-museum-was-more-than-i-expected/)
     				
     			
     		
     	

    ホームブログ | WordPress:Gutenbergに移行したら表示が微妙だから、クラシック枠からカスタムHTMLに移動させた紆余曲折

     [▲](#)
    
     We design with joy.
    
     		[ご依頼はこちらから](/contact/)
    
     		
    
     	- [contact](/contact/)
    
     	- [privacy](/privacy/)
    
     
    
     
    
     	- [**](https://twitter.com/toccaville)
    
     	- [**](https://www.facebook.com/toccaville)
    
     	- [**](https://www.instagram.com/itsmekumazo/)
    
     
    
     Copyright © 2026 [Toccaville](https://www.toccaville.com) All Rights Reserved.

{“prefetch”:[{“source”:“document”,“where”:{“and”:[{“href_matches”:”/”},{“not”:{“href_matches”:[“/wp-.php”,“/wp-admin/”,“/wp-content/uploads/”,“/wp-content/”,“/wp-content/plugins/”,“/wp-content/themes/toccaville/”,”/\?(.+)”]}},{“not”:{“selector_matches”:“a[rel~=“nofollow”]”}},{“not”:{“selector_matches”:“.no-prefetch, .no-prefetch a”}}]},“eagerness”:“conservative”}]}

/* */

/* */