PHP error : Warning: Uninitialized string offset 0

#525497
  • Resolved Victor Bardolle
    Rank Math free

    Hello Rank Math team,

    I just see that I’ve an issue related to Rank Math :
    Warning: Uninitialized string offset 0 in /home/clients/f47a43c4fc7eace605096204638e23e9/sites/qualidem.ch/wp-content/plugins/seo-by-rank-math/vendor/mythemeshop/wordpress-helpers/src/helpers/class-str.php on line 235

    I followed what you posted here PHP error and activate only Rank Math but the error is still here.

    The issue show only on some pages, not all the website.

    Rank Math : 1.0.107.3
    PHP : 8.0
    URL with issue : https://qualidem.ch/demande-de-devis/ or https://qualidem.ch/calculateur-de-volume/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.

    This error occurs if there is a whitespace or special characters in starting of the title. Please try checking for that in the affected page and if it’s there, then remove that from there, update the page and the issue should be resolved.

    Looking forward to helping you.

    Thank you.

    Hi Sakib,

    Thanks for your quick answer.

    Unfortunately, there is no whitespace or special characters in starting of the title. I use Rank Math on this website for a long time and that’s the first time I’ve this error (update issue ?)

    Disable all Rank Math options didn’t solve the option.

    Hello,

    I checked your site and it seems you are using %excerpt% variable in your page title, which was including whitespace itself and also making your title length much more longer than the ideal length.

    Hence, I’d not recommend using %excerpt% variable in your posts/pages title. Alternatively you can use any other variables and keeping your title length to ideal number(50-60 characters).

    For now, I’ve set a fixed limit of 60 characters by adding the following filter on your child theme’s functions.php file and the warnings are now disappeard from your site.
    https://pastebin.com/XtmArV6K

    Please note that after applying the filter above, the meta title length of 60 characters will not be visible in the editor. However, it will be applied and you can verify that in your page’s source code.

    If you don’t want to use the filter, you may remove that and use any other variables instead of %excerpt%.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘PHP error : Warning: Uninitialized string offset 0’ is closed to new replies.