Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?

You could change the whole text by adding first parameter to your comment_form function. According to the Codex, the code below might help:

$comments_args = array(
        // change the must log in text and link url
        'must_log_in'=> '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="https://wordpress.stackexchange.com/questions/131398/%s">logged in</a> to post a comment.' ), YOUR_CUSTOM_LOGIN_PAGE_URL ) . '</p>'
);

comment_form($comments_args);

Please change the ‘YOUR_CUSTOM_LOGIN_PAGE_URL’ accordingly.

Related Posts:

  1. Redirect already logged in users away from a page to a specific page base on user role
  2. Redirection plugin – how to let the editor access the ‘redirection’ menu?
  3. SSL redirect loop using WordPress HTTPS Plugin
  4. Redirection Plugin: Redirect all URLs with a regular expression
  5. flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
  6. Can Not Redirect from Plugin-Registered Admin Page
  7. Detecting $_GET parameters from any page + Cookie
  8. How to send “Location” header on plugin form submit event?
  9. Custom url structure for custom template
  10. Login with email (WP Modal Login)
  11. wordpress custom login successful redirect hook
  12. Can’t access my WP dashboard: fatal error? [closed]
  13. How to redirect Old Post URL to new Post and keep Old post Comments?
  14. What’s the _wp_desired_post_slug value for?
  15. Redirect all blog links from WordPress.com site to new domain
  16. WordPress login with Phone Number [closed]
  17. how can I link to a PlugIn admin-sub-menu page after processing a formular
  18. How does automatic redirection for the redirection plugin work?
  19. Changed permalink structure. Need help with redirecting old posts
  20. WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
  21. Landing Page Redirect Chain | http->https->https www
  22. Is there an earlier hook than login_head or login_enqueue_scripts?
  23. How can I check if on specific plugin generated page or child
  24. Redirection based on location but without affecting search bots
  25. Page Restriction and Redirect for Particular Levels or user
  26. how to create site exit messages with destination url displayed
  27. How to redirect a URL with parameters?
  28. WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
  29. Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
  30. How to fix the woocommerce – adaranth.com redirection issue [closed]
  31. Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
  32. How to use login_redirect with a user capability
  33. Enqueue stylesheet in plugin for wp-login.php
  34. Removing Automatic Redirects Without Plugin
  35. WordPress 4.3 broke meta redirect (with url params plugin)
  36. Edit Permalink Structure For Custom Post Type or Modify .htaccess?
  37. Mask and Track Outbound Links
  38. How can I redirect some pages to new subdomain? [closed]
  39. Add to array, redirect and display
  40. Possibility to login without password
  41. Conditional custom redirect
  42. Making the ‘add to cart’ button redirect to PayPal
  43. PHP mobile redirect Endless loop
  44. How to force load a page in plugin?
  45. wp redirect 301 not working in wordpress page
  46. Preserve Search engine index while shifting to new Domain
  47. Janrain/Simple Modal under Redirected Domain
  48. Redirect unloggedin users
  49. login form should redirect to register page for in 1st login next time it should redirected to home page
  50. Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
  51. www redirects to another directory in wordpress
  52. Hidden permalink different from displayed permalink
  53. redirect to homepage once action is completed
  54. Display value of the GET parameter in a new URL page
  55. Redirect to a page while maintaining search query parameters without causing an infinite loop
  56. Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
  57. wp_set_password() does not work!
  58. How to update all in-site redirect URLs to destination URLs at once
  59. How to send new visitor to a splash page for only one time in wordpress?
  60. WordPress Admin login redirect to homepage
  61. Why is my site still showing insecure icon even if I have SSL certificate?
  62. Reverse count page view and show on other page
  63. redirect to a custom page
  64. .htaccess file doesn’t work, with hundred tries
  65. Identify if the_post hook is being called from the admin post list
  66. Infinite 301 redirects after definitions in “Redirections” plugin?
  67. Clone a Post Tite and Custom Field into Custom Post type
  68. Direct URL to a template via plugin
  69. Redirect default login page to a custom page [duplicate]
  70. How to redirect from plugin page
  71. Template redirect inside of plugin not redirecting
  72. Can’t redirect to previous page after using GET
  73. Need to change contact email depending where user is from
  74. Redirect url in plugin to somewhere else?
  75. How do I to override login redirect on specific pages?
  76. Simple WordPress function / plugin to redirect a site
  77. How to validate password length in wordpress
  78. URL Redirect on GoDaddy platform [closed]
  79. Redirecting to page on form submit – Revue plugin
  80. how to make wordpress remember my choice
  81. Page with redirect
  82. Can’t change login logo & css – older plugin data blocking?
  83. Gravityforms login form custom redirect if form not submitted
  84. whole website redirected to another page
  85. Fatal Error in my WP “Call to undefined function get_option()”
  86. Show different page depending on user role
  87. add to cart linking to add to cart page
  88. How to force login on wordpress error
  89. wp_logout function not executed
  90. Add custom meta box on Post page
  91. Can installing a plugin delete an entire theme directory?
  92. Ajax : Call undefined function plugin_function() … can’t call any plugin function
  93. execute function after one completed
  94. Delete free version plugin will also delete premium plugin
  95. How to delete a theme using AJAX
  96. Licensing a Plugin [closed]
  97. Engadget Like Featured Breaking Plugin
  98. sliding/fading header plugin or approach suggestion
  99. Add code to page template on page built with Visual Composer
  100. Learnpress FATAL ERROR
Categories plugins Tags plugins, redirect, wp-login-form
jQuery .change() Event Bubbling in WP Admin
WordPress theme Modifications not showing up on live server

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress