next_post_link() actually creates an anchor tag, not just the URL.
Try something like below to just get the URL:
<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>
Related Posts:
- Modify previous and next text from pagination links
- Add a class to links in the visual editor (how to get old dialog back)
- Getting paginate_links() ‘end_size’ to display none
- WordPress AJAX Pagination with query_posts
- Static Frontpage Pagination – Custom loop
- I can’t fetch query parameters ($_GET parameters) with get_query_var
- WooCommerce – Customer Order History Pagination
- I want to remove the links from the term list returned by get_the_term_list
- Pagenavi pagination via wp-query in functions.php showing same content for each page
- How to check if comments are paginated?
- get understrap pagination to work with custom query
- Filter link to existing content suggestion
- Customized title tag for each page in pagination?
- Add “last” and “first” to WordPress Comment Pagination Links
- Change links automatically to affiliate links
- WordPress get pagination on wpdb get_results
- Sorting Posts | Alphabetical Order
- Getting rid of role=”navigation” in the Home Page Pagination
- How to get the Page Number of the Current Page in Single Post Pagination
- How to properly insert a link to a template in WordPress?
- How can I add pagination and how can I change thumbnail size?
- How can I properly control the numbers and dots that appear in pagination?
- wordpress count link clicks by ip address
- Increase returned number/pages on pagination
- Adding nofollow to a PHP generated Nav
- Using loop pagination on single.php
- WordPress 3.2 query_posts and pagination, permalinks issue
- Unreadable pagination
- How to show all pages in blog navigation?
- get_terms pagination
- Changes in permalink structure in WordPress and how to apply to in-site links
- Search not showing all results
- Pagination in plugin’s backend
- PHP code to use on next & previouspage links
- Pagination for custom shop loop woocommerce
- How to get post permalink url without a href
- How to create pagination for users list using custom array?
- Pagination on Custom Post
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- the_posts_pagination() not working in wpquery
- ACF Repeater Pagination stopped working since upgrade to php7.2
- Custom query vars filters problem with pagination
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- Automatically Add Page Links to Nav Menu
- Custom pagination (Previous / Next)
- WordPress pagination not working in search result page
- Remove Post if Advanced Custom Field is checked to fix paging
- How to add PHP pagination to wordpress
- Adding custom url to readmore link using get_permalink()
- page 1 is not paged
- Pagination stays on same page for post category
- How to set all External Domain Links with nofollow Attribute from Header Footer Content and Excerpt using PHP?
- Pagination in single.php
- How to work Woocommerce pagination inside shortcode?
- Help to modify wp_link_pages()
- Adding wp users ID into a link address from a DIVI modul
- Pagination contents not changing in Front page WordPress
- Load more posts using AJAX based on posts inside WP_Query
- How to stop hiding buttons forward / backward in pagination?
- How to make a pagination with dropdown selection?
- static page pagination not working
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- Pagination – Previous link is not show and Next link sticks at page 2
- Top Authors list by highest post views with Ajax pagination
- How can I get my pagination loop to display the correct number of total pages?
- Exclude a category slug on pagination
- What is the proper way to call a function (from functions.php) on a link click?
- Add a leading zero to pagination
- Get current_post in reverse order with pagination
- Change username link in admin bar
- Multisite – Display different header content based on which site is accessed
- Passing parameter from the current URL to redirect to another url
- Wrapping shortcode content in a span or link
- how to remove replicating a tag inside loop?
- changing static link to relative link
- Apply filters when loading post via ajax
- offset and max_num_pages in pagination gallery
- How to change this internal image link parameter using PHP?
- rewrite_rule – working fine but broken for pagination
- problem with category menu, it doesn’t want to show link
- How to fix blank pagination links?
- Make first child link default instead of its parent
- How to link a word comprised of a custom field with another?
- How can i list all user registered on my website and have pagination [duplicate]
- Pagination not displaying
- Pagination in category.php not functioning
- Link to external page has wordpress blog-url inside
- PHP code for link with text
- How to add pagination for wordpress home page
- Pagination 404 on my index.php
- Pagination not working properly
- paginate_links() returns NULL instead of the pagination links, but pagination is actually happening
- What does this if-statement do?: if($pages=’ ‘) {}
- Blog Posts not sorted and pagination not adjusted after filtering some category
- How to Set Page Pagination Using Ajax JQuery – WordPress
- Remove content links (internal and external), but exclude post at specific categories
- Custom post type removing /page/2/ from URL when trying to access it
- Remove links to the comments section
- Category Attachment Pagination 404 Error on 2nd Page