Page scroll to id


Page scroll to id is a fully featured plugin which replaces browser’s “jumping” behavior with a smooth scrolling animation, when links with href value containing # are clicked. It provides all the basic tools and advanced functionality for single-page websites, in-page navigation, back-to-top links etc. with features like:

  • Adjustable scrolling animation duration and easing (over 30 easing types)
  • Link and target highlighting via ready-to-use CSS classes
  • Vertical and/or horizontal scrolling
  • Scrolling from/to different pages (scrolling to target id on page load)
  • Offset scrolling by pixels or element selector with custom expressions
  • Insert link and target id buttons in post visual editor
  • Link-specific offset, scrolling duration, highlight target etc.

Demo (default animation duration/easing, link highlighting etc.)

Plugin resources, links and tutorials


Page scroll to id requires WordPress version 3.3 or higher (jQuery version 1.7.0 or higher) and your theme must (and should) have wp_head() and wp_footer() functions. In some Microsoft Windows based web servers some plugins might produce an error 500 (depends on server/PHP configuration). To pinpoint the issue enable debugging in wp-config.php and check wp-content/debug.log file for relevant errors.

Quick usage and tips

  1. Install the plugin.
  2. The plugin is enabled by default on your WordPress Menu links, so you can start adding custom links and set their URL to the id/target you want to scroll to.
  3. Create id targets within your content using plugin’s “Insert Page scroll to id target” button and/or shortcode (see contextual “Help” menu in plugin settings page) in post visual/text editor. Create targets in widgets areas using “Page scroll to id target” widget.
  4. Create links within your content using plugin’s “Insert/edit Page scroll to id link” button and/or shortcode in post visual/text editor. You can also add the class ps2id on any existing link you want to be handled by the plugin.

For more info see plugin’s basic tutorial



You should have received a copy of the MIT License along with this program.
If not, see


If you like this plugin and find it useful, consider making a donation :).

Plugin previous/other versions

Other/external resources


  • "Page scoll to id" settings

  • "Page scoll to id" settings help

  • Multiple selectors in plugin settings

  • "Page scoll to id" target widget and widget id values

  • Visual editor "Insert/edit Page scoll to id link" modal

  • Visual editor "Insert Page scoll to id target" modal



  1. Click ‘Add New’ under ‘Plugins’ menu in WordPress.
  2. Perform a search for the term ‘Page scroll to id’ and in search results, click ‘Install/Install Now’ under plugin name.
  3. When installation is finished, click ‘Activate Plugin’.


  1. Download and extract the plugin.
  2. Upload the entire page-scroll-to-id folder to /wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress.


Configure plugin options by clicking ‘Settings’ under plugin name or through the ‘Settings’ menu in WordPress administration.


Please visit plugin’s Knowledge Base – FAQ for up-to-date info and guides.


Handy plugin with great support

This plugin did exactly what I needed it to do which was add a smooth scroll with anchor links in the main navigation. The support I received was the best I have ever had from a WP plugin author. Support responses were clear, informative, and fast. I’m very impressed and very grateful!

Very useful to create a modern page scroll effect

This plugin is very useful to create a modern page scroll effect when you click on links which bring to different positions in that page. For example, I created a unique long page with different sections which can be individually reached with a nice scroll effect by clicking on the menu items of a secondary right-side menu.
The plugin is very well done and the support form the author is prompt and very effective.

Exactly what I wanted!

This plugin was exactly what I wanted and had been searching for! It took a bit of work to figure out and set up but their support was top-notch – extremely helpful and friendly! I think this is really a great plugin to use for the scrolling feature along and the highlighted sections in the menu is just an absolute bonus. I truly couldn’t be happier with the result.

Wonderful and easy to use

I built a custom one page theme and I use this plugin for navigating through the pages.
It is truly awesome and very easy to use.
My favourite functions are the integration into the wordpess menu and above all the offset function that allows you to offset the scroll by selector, i.e. set the offset to the Header height, even that height it is dynamic. I love it.

Read all 108 reviews

Contributors & Developers

“Page scroll to id” is open source software. The following people have contributed to this plugin.




  • Changed default options for scroll duration and easing type. Plugin is now enabled by default on WordPress menu items/links. These changes affect only first-time installations (upgrading won’t change these options).
  • Extended plugin’s settings page and renamed few options to less technical terms.
  • Added special class/option for creating links with alternative scroll duration/speed.
  • Extended plugin buttons on WordPress visual editor (non-shortcode links, custom classes etc.).
  • Added new option ‘Append the clicked link’s hash value to browser’s URL/address bar’.
  • Added new option ‘Stop page scrolling on mouse-wheel or touch-swipe’.
  • Added new option ‘Prevent other scripts from handling plugin’s links’.
  • Added new option ‘Normalize anchor-point targets’.
  • Relative-root links are now properly highlighted.
  • Added wp-config.php option for selecting which script files the plugin loads (minified or uncompressed).
  • Only necessary CDATA values are passed on the front-end script.
  • Added compatibility for latest non-WordPress jQuery versions (2.x and 3.x).
  • Fixed a bug regarding shortcode’s offset attribute when used with “auto” layout.
  • Fixed a php notice when updating plugin from version 1.6.0.
  • Added workaround for IE/Edge not starting from the top when scrolling to hash on page load.
  • Updated readme.txt, contextual help and documentation.


  • Added additional default selectors: .ps2id > a[href*='#'],a.ps2id[href*='#'].
  • Added “Page scroll to id target” widget.
  • Added custom buttons in WordPress visual editor for plugin’s shortcodes insertion.
  • Added new option ‘Enable on WordPress Menu links’ in plugin settings.
  • Fixed browser’s history back button when ‘Scroll to location hash’ option is enabled.
  • Updated readme.txt.
  • Extended help and documentation.


  • Fixed contextual help shortcut links in plugin settings page.
  • Added new option ‘Enable for all targets’ for ‘Scroll to location hash’.
  • Added new option ‘Delay’ for ‘Scroll to location hash’.
  • Fixed an issue regarding invalid selectors with location hash.
  • Updated readme.txt.
  • Updated help.


  • Extended ps2id shortcode for creating div elements (in addition to anchors).
  • Added ps2id_wrap shortcode for creating target wrappers in content editor.
  • Extended offset selector expressions with :position, :height() and :width().
  • Updated readme.txt.
  • Updated help.


  • Fixed various PHP notices in debug mode.
  • Minor script optimizations.


  • Added ‘Highlight by next target’ option. When enabled, highlight elements according to their target and next target position (useful when targets have zero dimensions).
  • Extended ps2id shortcode for creating targets in content editor.


  • Changed the way ‘Force single highlight’ option works. When enabled, it now highlights the first highlighted element instead of last.
  • Extended highlight and target classes with additional ones in order to differentiate the first and last elements. You can now use .mPS2id-highlight-first, .mPS2id-highlight-last, .mPS2id-target-first and .mPS2id-target-last in order to target the first and last highlighted links and targets in your CSS.
  • Added ‘Keep highlight until next’ option. When enabled, the plugin will keep the current link/target highlighted until the next one comes into view (one element always stays highlighted).
  • Added ‘Disable plugin below screen-size’ option. Set the screen-size (in pixels), below which the plugin will be disabled.


  • Fixed contextual help links in plugin settings page.
  • Updated Offset field to accept comma separated values for defining different offsets for vertical and horizontal layout (e.g. 100,50).
  • Added ‘Scroll to location hash’ option. When enabled, the plugin will scroll to target id (e.g. <div id="id" />) based on location hash (e.g. on page load.
  • Updated readme.txt.
  • Updated help.


  • Fixed a minor bug in jquery.malihu.PageScroll2id-init.js.
  • Updated screenshots.
  • Updated readme.txt.


  • Extended Offset option to accept element selectors in addition to fixed pixels values.
  • Added ps2id shortcode for creating links in content editor.
  • Added the ability to define link specific offsets via the html data attribute: data-ps2id-offset.
  • Fixed some minor issues for WordPress versions lower than 3.5.
  • Updated help and external links.
  • Changed plugin license from LGPL to MIT.


  • Minor code tweaks.


  • Minor code tweaks.
  • Minified scripts.


  • Dropped jQuery UI dependency (jQuery UI is no longer required for the plugin to work).
  • Fixed the bug of non-working links to other pages. The script now checks if href values refer to the parent document, before preventing the default behavior.
  • Fixed the bug regarding selectors referencing body class not working.
  • Any link handled by the plugin with href value #top will now scroll the page to top, if no element with id top exists.
  • Added links highlighting feature. The script adds a class (default: mPS2id-highlight) automatically on links whose target elements are considered to be within the viewport.
  • Plugin adds a class (default: mPS2id-target) automatically on targets that are considered to be within the viewport.
  • Plugin adds a class (default: mPS2id-clicked) automatically on the link that has been clicked.
  • Added offset option: Offsets scroll-to position by x amount of pixels (positive or negative).
  • The plugin script now fully validates href values and ids before scrolling the page.
  • Fixed varius minor bugs.
  • Code rewritten and optimized for better performance and maintenance.
  • For more see Plugin changelog.


  • Added support for jQuery version 1.9.


  • Removed the hard-coded plugin directory URL in order to fix errors of pointing .js files to a wrong location.


  • Launch!