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
- Get the content of a specific page (by ID)
- How to give paged links custom title?
- Show Default Editor on Blog Page ( Administration Panel )
- Create pages automatically if they don’t exist
- How to redirect on particular page in wordpress? [closed]
- Can I display the widget admin in the page admin?
- Hide page visual editor if template is selected – redux
- Page template gives ‘Parse error: syntax error’ when used, but no error found!
- more tag in the $post->content when get_pages were used
- Different “Text Widgets” in Sidebar on Many Different Pages?
- 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
- Guidelines for adding static pages
- Show child pages when on a child page
- Sitewide page on all the blogs in the network
- How to create a page when a theme is activated?
- How to echo excerpts with wp_list_pages?
- Remove pages from backend list *and* update counter accordingly
- Creating a form contact page?
- How to call wp_list_comments() outside of the comments template?
- Using Pages to handle calls for custom post types
- Displaying Subpages while on Parent page?
- Can’t see content on page to edit
- Show own shortcode data on each page
- Pages views limit [closed]
- How can I get the homepage from the loop?
- Having wordpress page accesss issue under sub-directory
- How to make my category archive behave like a page
- Edit custom HTML page from WP admin dashboard
- get_pages() as per custom menu order
- Display child pages in sidebar of parent page in wordpress
- How to use is_admin in page content?
- List all posts with the parent or grandparent of a page with a specified ID
- From a developer’s point of view what are the differences between pages and posts? [closed]
- Page titles for internal classification of landing pages
- Function to incorporate an option in each Page
- Displaying direct children of other pages on homepage
- How do I reference the front page’s parent Page object?
- How to bypass 404 for certain pages/posts?
- Displaying Current Page Number Conditionally
- Multiple Loops That Pull Pages (Child/Grandchild) While Styling the First Entry
- How do i pick the pages in 20-11 header?
- How to show page title with capitalization only as I typed in?
- Create custom page to author.php
- Make Audio Element Persistent Across Pages
- Show children connected to parent pages
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Restrict specific private page to a specific user
- How to remove a page in its entirety
- Editing Pages Icons Are Not Showing Up – Why is this happening?
- How to add custom php file to right sidebar?
- Why my home page doesnt work?
- Mailchimp RSS feed work with single wordpress page?
- How to publish pages under a subdomain url?
- how to setup subdomains for pages?
- How to approach need for virtual page on my WP site?
- Creating content using wp-admin pages
- change page status with code
- Is it better to set social media sharer in entry-footer.php or comments.php in WordPress blog?
- Get All Pages as strings in array
- Attach link to pages accoding to tags
- Search Page: activate html code if the tag is on the page
- How to end the Page Load Event and load after that?
- Issue with page not erasing
- My page won’t publish
- Pages redirecting to homepage
- How to migrate .HTML pages to WordPress
- Why does the default Insert/edit link function in Visual mode in posts or pages produce full urls?
- Custom admin menu for a selection of pages
- how to print the content of pages inside the front end area
- How do I make just one of my pages a Blog Page?
- Standard way of creating profile pages with custom content for each user?
- How to show parent pages on a specific page if user is logged in?
- Create custom archive page for individual authors which is separate from the author.php page
- Display list of posts with x tag within a page?
- display new WordPress page content
- Dashboard show only published pages instead of all pages
- How to get a list of pages (not posts) with specific tags?
- Adding a Admin Style Table in a WordPress 4.x Page