In the new WordPress (WP 5+) Editor – Gutenberg, you can use a “Custom HTML” block to prevent the automatic line breaks and paragraphs:
on Visual Editor click + > Formatting > Custom HTML – and put your JavaScript in there
on Code Editor enclose your JavaScript with <!-- wp:html --> <!-- /wp:html -->
Related Posts:
- Add infinite scroll to content splitted post
- What are the options for running custom css and javascript files on a page?
- Using JavaScript and JQuery in Page
- Backend option to include a javascript file on specific pages?
- WASM page in WordPress website
- Can I include Javascript/jQuery in a page?
- Add a predefined page to site
- Text Editor Tags
- Adding a Calculator to a WordPress Page
- JQuery Plugins in WordPress
- loading a javascript on a WP PAGE
- How To Render Shortcode In AJAX Response?
- Showing Different Code on Pages With Different Layouts
- Using WP just to edit pages of an existing site
- Stop playing music (rev slider) when user opens new tab
- Press This for Page
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- Javascript will not run properly
- How to get current page ID outside the loop?
- Get the content of a specific page (by ID)
- Show Default Editor on Blog Page ( Administration Panel )
- Create pages automatically if they don’t exist
- WP Page and Subdirectory with same name
- How to redirect on particular page in wordpress? [closed]
- Hide page visual editor if template is selected – redux
- Automatically change page password
- Too many pages causes WordPress admin to be unusable
- How to get the list of posts in a static page other than front page?
- How can I make Disqus comments not show up on pages?
- Enqueuing Script in functions.php vs on the page
- CMS: Making complex pages editable by the end user
- Show child pages when on a child page
- Sitewide page on all the blogs in the network
- How to display thumbnail and excerpt of a page on homepage?
- How to create a page when a theme is activated?
- WordPress Admin – Add Edit link to specific page under Pages Menu
- Show child pages and sibling pages on the child page
- How do I use featured images on index.php?
- Creating a form contact page?
- Problem With Pages Displaying
- Removing the TinyMCE editor for a given page template
- Missing Pages (Drafts?)
- WordPress redirects me to posts page after editing one page
- Getting to a specific page on website using specific code instead of navigation bar
- Can’t see content on page to edit
- Show own shortcode data on each page
- How can I get the homepage from the loop?
- Integrate OpenStreetMap on WordPress
- Suddenly forbidden 403 error on some pages
- How do I Name a WP page in the New(ish) Block Editor?
- How to select a specific page
- This code won’t find authors page?
- WordPress backend:How to hide some specific pages under Pages–>All Pages
- Different header for each page in child theme of twenty thirteen
- Change a Page’s Header Image
- How do I edit text displayed on my browser tab?
- Page menu not showing in admin, new Page button missing in toolbar too
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Order by modified date working in POSTS but not PAGES
- append one page content into another
- WordPress Page doesn’t load the template selected
- on page creation few inline style properties gets removed
- Custom folder for wordpress page templates
- way to make all pages with certain tags public?
- Page not appearing under its Parent
- Can I use Pages like a Wiki
- list child-pages as normal pages?
- return page name in url
- Create multiple pages with tables from json file
- Search anything from a Child and Sub-Pages of their Parent page
- Can i use 2 page content-forum & content-forum-slug on bbpress?
- Attaching a file to a page without adding to media library?
- Change page width in refined magazine/mag and news theme
- How do you run code on a specific page without missing the init hook?
- Requiring a Visitor to Enter a Password Each Time They visit a Page
- if is_page() is not working with wp_redirect
- Display meta data attribute in user profile
- Assign Parent Page – Now 404 Error
- WordPress displays widgets out of whack
- WordPress form submit to custom page template does not work
- Two different layouts for the same post
- My page title turns into a h2 tag – What to do?
- How do I locate a third party page represented as a slug in my WordPress website?
- Customise the_title in admin area
- Add pagination to search.php page
- problem with loading pages
- Content not displaying on page
- Blank white space where header was [closed]
- Display child pages on homepage template
- Set order acs and no paging for archive page
- Pageview all of sudden not working
- Childpage title + content on Parent Page
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- Filter posts by author selected in page
- Temporary download page or restrict static download page based on how the user got to the page?
- List Parent page with sub pages
- wordpress user profile page
- WordPress is picking up links that don’t exist
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?