There are three types of outputs you can get from paginate_links()
, but all of them are going to have <a>
inside of them.
I think an easy solution would be to use PHP to just strip out the <a>
tag for you. Rather than echoing back paginate_links()
, store that in a variable and then use preg_replace()
to take out the anchors and echo that back:
$pagination_link_output = paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => 'page/%#%/',
'current' => $current_page,
'total' => $total_pages,
'prev_next' => false,
'type' => 'list',
));
echo preg_replace('#<a.*?>([^>]*)</a>#i', '$1', $pagination_link_output);
You can also filter if you wanted to go that route:
https://developer.wordpress.org/reference/hooks/paginate_links/
Hope that helps!!